There are many reasons why a PC unexpectedly shuts down, but the most common reasons involve problems with the power supply. It is possible that the battery is failing to hold a charge, or the charger may be malfunctioning. Another common cause is an overheated CPU. Check to see if there is dust or anything blocking the fans on the bottom of the computer.
If these reasons are not the cause of the problem, there might be an issue with the hard drive or the operating system. If the operating system was recently upgraded, this is the most likely reason the computer is shutting off unexpectedly. To fix this problem, turn the computer off and then restart it in safe mode. Next, locate the "System Restore" feature. This feature provides an option to undo recent changes, such as an upgrade to the operating system.
Another possible solution is to restore the computer. When the computer turns on, select "Advanced Boot Options," and find the option to restore the computer. If none of these steps solve the problem, take the computer to a professional. It is possible that there is a problem with the wiring. This is something that requires certain skills, so it is best not to attempt to fix this without the necessary experience.