As far as I understand your system is hanging and this causes automatic restarts. If so, I'd first recommend the following:
Restart the system into BIOS by pressing during the boot process. Once in the BIOS setup utility, press to restore BIOS default settings. Reset any customized BIOS settings. Clear all DMI event logs by setting the option to "Enable", which is located in the Advanced/Event Log Configuration section of the BIOS Setup utility. Press to save the new settings and reboot the system.
If the problem continues, please, provide more details regarding the problem description and details on how your system is set up.