Computer restarting randomly

Hello, my computer has been restarting randomly.

I did a complete reformat and installed a fresh windows.

After the install, it restarted again.

It does it randomly, sometimes after an hour, somtimes after 10 min, random…

so yeah i need help fixing this problem

i dont think its heating because my cpu is at 30 degrees right now, so yeah.

help please =D.

edit---------------------------------

sometimes my computer restarts and sometimes it just freezes.