Hi,
Thanks for your post in Microsoft Community.
I understand that you are having a problem with a newly assembled computer that keeps restarting automatically.
Problems with a new computer restarting automatically with Windows just installed are mostly caused by hardware problems.
You can check the BIOS settings for incompatible settings or wrong settings, such as SATA Mode or Serial ATA Mode found, select and press enter, select combined
Mode, if there is no combined mode, it is set to IDE mode.
Check temperature. Check to see if there may be a problem with the cooling of the computer, a device overheating and restarting.
Check memory. Insert the two pieces of memory into the test separately, one at a time, to see if there is a problem.
Check the hard drive. Replace a hard drive that has been used or has been confirmed to work for testing.
Remove the GPU to test. Do this to see if it might be a problem with the GPU.
These tests are not complete, but they can be prioritized, and it would be better if there are professionals to help with testing.
Please feel free to let me know how it goes.
Kirk | Microsoft Community Support Specialist
* Beware of scammers posting fake support numbers here.
* If your problem is not solved, you could reply to the post again and we would continue to provide technical support for you.
* Please check and vote this answer if it helps as it will be beneficial to more community members reading here.