You are using a desktop PC, right? Could you tell me after which screen your PC restarts? Is it possible to open the BIOS menu and navigate there without any problems? If it is, the issue may be Windows related and you should think about reinstalling the OS.
If the PC restarts randomly there may be a hardware issue and I would suggest you to check the power supply unit. If it is not working properly or it is about to fail, it may harm other hardware too. If you have the option, test the PC with another power supply.