There is https://en.wikipedia.org/wiki/Magic_SysRq_key but I’ve had some hit and miss success in actually getting it to work.
Normally I first try see if it is only the graphical interface that has crashed by pushing ctrl+alt+F1 or F2 or F3 to try and switch to another terminal. If I can switch, I log in and reboot or restart the window manager.
I also try SSH into the machine if I have another of around.
If I do reboot, then I use ‘journalctl -b-1 -e’ to see what happened at the time the system froze.
I know this doesn’t solve your immediate problem when using GNOME, but if you are desktop curious, KDE natively offers sharing a portion of the screen or even creating a whole new virtual monitor with its own resolution, wallpaper etc that you can share.
So my typical workflow is to have it create a 1080p virtual monitor above my real monitors, and share that, since sharing a full 4k monitor makes it hard for people to read. Then I can show whatever I want on that monitor without worrying about exposing something from my main monitors.