How can a computer shut down and restart?

Solution
if it turns of then on (like reboot) than its cpu/ram overclock fail
if it turns of then it could be bad psu, cpu fan error, overheating
it it only reboots than it could be anything