I’ve ran CPU GPU and memory stress tests to see if any of them were overheating but temps seem stable. Basically if I’m in a game or program the PC will cut the display and rev the fans full blast until I restart it. I’m guessing at this point either the PSU is going or it’s spiking for some reason and turning itself off to prevent damage.
Check if you have driver updates, could be a driver crashing. Also check if you have a bios/uefi update, sometimes stability issues like this are fixed in bios updates.
If you have another known good psu, use it to test if you still have these issues.