Power winking out will do that. Is the computer on a working UPS? Double check that the power cord is fully plugged in at both ends. It's amazing how often problems like this turn out to be a plug that got partially pulled out and touching the cord momentarily breaks the connection.
If that is not it, good chance it is a temperature-related fault. After it restarts the first time, does the time to restart again shorten (you would expect that if the problem is related to temperature)? Temperature problems could be a bad component, a poor connection (within a connector, a chip socket, or solder joint), power supply, or messing with the internal settings that control the fans. Open the case and verify that the air vents are not plugged with dust and the fans are running. See if operating with the case open makes a difference. One at a time, disconnect ribbon cables, blow out the connector and blow off the contacts and reconnect. Do the same with the RAM modules (when handling them, keep your other hand on a metal part of the chassis and be careful not to touch anything but plastic on the module). Blow off all of the fans and blow out all of the air holes in the case and on the power supply. When the symptom is brief, like triggering a restart, and at an unpredictable time, it can be very difficult to locate. Tricks like cooling a component with a can of compressed air aren't helpful. You generally need test equipment to monitor temperatures and signals. If you find a fan that's not working, you will luck out.
It is also possible that the problem is software related. Does the restart always happen while you are doing something, does it always happen while the computer is idle, or do the conditions vary? If you follow a "routine" in how you use the computer, you could arrive at the condition that triggers a restart at around the same time each day. It could be something you do that triggers the fault. If you have activities that run in the background, like a backup program, a fault related to, or experienced by, that program could be the trigger and your daily routine could put it at roughly the same time each day. You will need to be a bit of a detective and keep track of what is going on at the time of the restart to begin to narrow down the possibilities.