First, disable the automatic restart feature so you can see any error messages that might help diagnose the issue:
Press Win + R, type sysdm.cpl, and press Enter.
Go to the Advanced tab.
Under Startup and Recovery, click Settings.
Uncheck Automatically restart under System failure.
Click OK.
Look at the Event viewer error logs:
Press Win + X and select Event Viewer.
Navigate to Windows Logs > System.
Look for critical errors or warnings that occurred around the time of the restart
Check for Overheating:
Ensure your PC is free of dust, especially around fans and heat sinks.
Use software like HWMonitor, SpeedFan, or Core Temp to monitor your CPU and GPU temperatures. High temperatures (generally above 85°C for CPUs) can cause restarts.
Try tools like MemTest86
Make sure your system is free of malware.