My PC used to shut off after less than an hour of playing games, and the motherboard lights sometimes struggled to stay on. I replaced the EVGA 650W power supply with an ASRock 850W unit and replaced the AMD stock cooler with a Thermalright Peerless Assassin. I used only the cables that came with the new power supply.
The motherboard now stays powered consistently, but the computer shuts down when Windows begins loading. If I disconnect the hard drives and boot from an M.2 drive, I can sometimes reach the desktop, although it may still shut down when I enter my password. Booting into the BIOS first and manually selecting the main drive seems to work more often. The two CPU fans are detected correctly in the BIOS.
The motherboard cycles through orange, red, green, and white diagnostic lights before turning off. Temperatures look normal: around 39°C for the CPU and 35°C for the motherboard in BIOS, and roughly 110°F in Windows. I currently have only a keyboard, mouse, and Windows installation USB connected.
My hardware is a Ryzen 5 5600X, EVGA RTX 2060, ASUS TUF B450 motherboard, 32GB of Corsair DDR4, two NVMe drives, and two Seagate hard drives. I have also tried disconnecting the hard drives and am considering a Windows reset.
4 Answers
Try a minimal configuration: motherboard, CPU, one RAM module, graphics card, the boot NVMe drive, and only the keyboard and monitor. Leave the SATA drives and unnecessary USB devices disconnected. Run a memory test and, if possible, check whether the system remains stable in a Windows installer or a Linux live environment. If it shuts down there too, the issue is probably hardware rather than Windows.
Try isolating the storage devices one at a time. Disconnect both SATA drives completely, including their power and data cables, then test Windows with only one known-good NVMe drive connected. If it still shuts down, reconnect the drives individually and try a different modular SATA power cable from the new PSU. Never reuse modular cables from the old PSU, even if the connectors fit, because the pinouts may be different.
The temperatures you reported do not suggest a cooler problem, and the Peerless Assassin should be more than adequate for a 5600X. Check that the cooler is mounted evenly, the CPU fan is connected to CPU_FAN, and the 8-pin CPU power connector is fully seated. Also reseat the 24-pin motherboard connector, graphics card, and memory. Since the system worked inconsistently after hardware changes, a loose connection is possible.
The motherboard diagnostic lights cycling during startup is normal if they eventually pass, but note which light remains on when the shutdown occurs. Test with one RAM stick at a time, preferably in the recommended slot, and clear the CMOS before trying again. If the computer stays on in the BIOS but shuts down only after Windows loads, storage, drivers, or the operating-system installation become more likely than overheating.
A Windows reset may help if the installation or a driver is corrupted, but I would first test with the extra drives removed and verify the PSU connections. A reset will not fix a failing drive, cable, motherboard, or power supply.

It is also worth testing each hard drive with only its data cable attached and then with only power attached. A damaged drive, cable, or power lead can cause shutdowns during Windows startup.