The PC can shut down for one of several reasons. Some time ago the Corsair AX860i started displaying a red LED indicating a fault. The only way to recover it was to cold start the machine. The LED was helpful to identify the problem. Eventually I was forced to RMA the AX860i and now the HX1000i has replaced the old PSU.
If the PSU fails then the machine may shut down unexpectedly with idle tasks. Most power supplies do not have a status LED or monitoring like Corsair’s elite power supplies. A low cost PSU tester can quickly see of the PSU is still working. These sell for under $10 on eBay.
Many use a woefully inadequate power supply which can be troublesome. Today a Corsair 650W PSU is very affordable and very unlikely to be troublesome. The RM650 is very efficient at lower power levels so it pays for itself fast. The RX750 and RM850 are also available for those with higher current requirements. The high end AX1200 is popular with dual card users.
Overheating leads to the thermal throttling of the CPU or GPU. If the CPU overheats the machine will shutdown to prevent permanent damage. Arctic MX-4 is a good thermal material when used a very small amounts.
Rarely the video card may have failed. Usually the card shows anomalies unless the ASIC itself is toast. System RAM faults usually present BSOD events.
Installing more fans in a rig can do wonders for thermal management, the more fans the better up to a point. Chassis fan mounts are present on almost every model for adding additional fans.