This issue can have multiples causes. Most of them are:
- corrupted system files
- corrupted registry entries
- faulty hardware components
- malware infection
- compatibility issue
To fix the system files corruption, go to Start > Run > and type sfc /scannow.
Notice: Windows installation disk might be necessary to restore the corrupted files.
Corrupted registry entries
Try to install CCleaner and use the built-in Registry menu to scan for obsolete and bad registry keys. The software will delete those keys automatically. You can also backup the files that will be deleted.
Faulty hardware components
Try switching memory modules between one slot and another and replace other components such as GPU, CPU, HDD with new ones.
You can scan your computer with Combofix to eliminate any malware infections 0that might be present. This is a major cause to computer restart because the malware files affect the system's functionality.
If you've installed any applications lately, make sure to remove them because they may cause serious issues related to functionality of your OS, therefore causing restarts or freezes.