PSA: If your PS5 shuts down randomly, and doesn't give you an overheating warning before hand, it's the power supply in the system overheating.
This has turned into a general notice about what to look for when fixing overheating. Take it as you will.
Either through dust or some other reason it'll be the power supply over heating and shutting off. Don't bother messing with the CPU if the PS5 isn't giving you that overheating warning.
After cleaning out the PS5 and still overheating, I wasted time messing with the liquid metal thinking it was the CPU, then had to figure out it was the power supply. Cleaning off the PSU will work majority of the time, but sometimes gunk and dust can really settle inside and you can't clean it unless you open it up, which is VERY DANGEROUS TO MESS WITH. Unless you have a professional dealing with it don't even bother. You can purchase a new PSU online, just be sure it's the right kind of model.
You probably have a warranty on your PS5 send it in... Honestly the fact the PSU can get that bad seems like a manufacturing issue, but idk. Just wanted to throw this out their to y'all.
Edit: One of the comments had the issue without the warning, but turned out their CPU was the issue. Usually the PS5 will put the warning up if it's from the CPU, but I guess the senors don't always pick it up. After cleaning out the PS5, if it still doesn't work then it's probably worth checking the iquid metal on the CPU first. You'll need specific tools to fix it. https://a.co/d/7SioQor this is what I used. Checking the liquid metal is still cheaper to do than a whole new PSU, but also make sure the PSU and everything else is totally clean, THEN check the liquid metal if it still doesn't work. Tons of guides on YouTube that'll show you how. If nothing works, then there is an issue with the PSU and you need to replace it with a whole new one.