What you describe doesn't just happen out of nowhere, a game isn't going to make your components blow up and melt. Modern components are made in a way that they will downclock themselves if they begin to hit temps that are too high, it doesn't just keep getting hotter until it melts. This is more in the realms of an electrical fault. Even if you had one of those teeny tiny zoomer cases that are popular right now that cram everything into a tiny space it'll downclock or shut down long before it bursts into flames even in a hotbox like that. Locking framerate to your display in the settings is a good way to reduce heat as the GPU doesn't have to work as hard to maintain that framerate instead of going full power to give you 300fps for no reason. You can also undervolt with Afterburner or a program that allows you to do so if it's toasty. My 3080 in game running my 144hz display at a constant 144fps gets to about 65 and it's summer here so the room is pretty warm alone.

If your temps are out of control somethings either very old and full of dust or fixing framerate lower will fix it.