Computer unexpectedly restarting may be caused by software or hardware issues. You should troubleshoot the issue by doing the following:
- Scan the system for any viruses or malware
- Make sure the computer has enough RAM and storage
- Check the device’s energy settings
- Check the fans and internal temperatures
- Run a diagnostic test from the computer manufacturer