Youtube can punish you with lagging and excessive RAM usage if it detects anything modifying the page.
Make sure Opera's adblocking and tracking prevention is completely off at the URL opera://settings/privacyProtection, make sure RGX is off at the URL opera://settings/lucidMode, make sure web modding is off at the URL opera://settings/web_modding, make sure shaders are off at the URL opera://settings/shaders, and make sure you're not using any adblock extensions at the URL opera://extensions that are getting detected by Youtube.
Then, goto the URL opera://settings/content/all, type youtube.com in the search field and click "Delete displayed data". Then, repeat for google.com. Then, goto the URL opera://settings/clearBrowserData and clear "Cached images and files" for all time. Then log back in to Google and Youtube. That should clear any adblocker detected nonsense.
As for performance on Youtube, in addition to the above, make sure graphics acceleration is enabled at the URL opera://settings/system, make sure you're not using any limiters in the GX Control sidebar panel and make sure the battery saver is disabled at the URL opera://settings/batterySaver.
Also, if needed, you can adjust the Angle flag for your GPU.
Also, sometimes issues on Youtube can be caused by GPU drivers. If you're using a gamer ready driver for example, try the stable/studio driver instead. Or, try the previous driver version.
Or, if you're happy with Edge, keep using it.