Goto the URL opera://about and check for updates. If it says there are no updates, reload the page a few times to be sure. Maybe there's an update that fixes things.
R9 9950x and RX 7800xt still your CPU and GPU?
The 9950x has a built-in GPU too, right?
You can goto the URL opera://settings/system, make sure "graphics acceleration" is on. Then, adjust the Angle flag for your GPU to see if you can find an option for the flag that doesn't trigger crashes with your GPU while keeping things hardware-accelerated at the URL opera://gpu.
You'll also see on that link that you can set a flag to try to force Opera to use your 7800xt instead of the GPU built in to your 9950 CPU. You can also do that in settings in Windows by going to "System -> Display -> Graphics, adding Opera to the list and setting it to use the 7800xt.
Another thing you can try doing is disabling HDR for your display to test if it avoids the crash/freeze.
For Youtube, in addition to completely disabling Opera's adblocking and tracking protection at the URL opera://settings/privacyProtection, you should disable lucid mode at the URL opera://settings/lucidMode. It can cause problems and sometimes crashes.
I would also test in a test standalone installation of Opera to test if it eventually causes your computer / Windows to freeze too or not. If not, that could mean something is corrupted with your data and or program files for your regular install of Opera.
You could also try loading the Windows Event Viewer and searching for errors related to your GPU / GPU driver. Might eventually find something. See https://www.google.com/search?q=windows+event+viewer+blue+screen for an example of how you filter the events for blue/back screens. That might not help for freezing, but it's an example to show you how to filter based on some criteria at least. You can search for temp-related errors instead too.
At https://www.amd.com/en/support/downloads/drivers.html/graphics/radeon-rx/radeon-rx-7000-series/amd-radeon-rx-7800-xt.html, maybe try the "recommended" driver instead of the "optional" one. Or, vice versa.
You could test your RAM too.
Temporarily test with Vivaldi to see if the freeze / crash eventually happens with it. Vivaldi is a god comparison to Opera, especially with media handling.