Steve DeLassus asked me the other day what I would do to fix a PC that was rebooting itself periodically. It’s not him who’s having the problem, he says, it’s someone he knows. He must be trying to show up someone at work or on the Web or something.
So I gave him a few things I’d check, in order of likelihood.

Static electricity. A big static shock can send a system down faster than anything else I’ve seen. Keep a humidifier in the computer room to reduce static electricity. If you’re really paranoid, put a metal strip on your desk and connect it to ground (on your electrical outlet, not on your PC) and touch it before touching your PC. Some people metalize and ground part of their mouse pad. That’s a bit extreme but it works.

Power supply. This is the big one. A failing power supply can take out other components. And even if you have an expensive, big-brand box like a PCP&C or Enermax, they can fail. So I always keep a spare ATX power supply around for testing. It doesn’t have to be an expensive one–you just want something that can run the machine for a day or two to see if the problem goes away.
Overheating. Check all your fans to make sure they’re working. An overheated system can produce all sorts of weird behavior, including reboots. The computer we produced our school newspaper on back in 1996 tended to overheat and reboot about 8 hours into our marathon QuarkXPress sessions.

Memory. It’s extremely rare, but even Crucial produces the occasional defective module. And while bad memory is more likely to produce blue screens than reboots, it’s a possibility worth checking into. Download Memtest86 to exercise your memory.

CPU. If you’re overclocking and experiencing spontaneous reboots, cut it out and see what happens. Unfortunately, by the time these reboots become common, it may be too late. That turned out to be the case with that QuarkXPress-running PC I mentioned earlier. Had we replaced the fans with more powerful units right away, we might have been fine, but we ended up having to replace the CPU. (We weren’t overclocking, but this was an early Cyrix 6×86 CPU, a chip that was notorious for running hot.) Less likely today, but still possible.

Hard drive. I’m really reaching here. If you’re using a lot of virtual memory and you have bad sectors on your hard drive and the swapfile is using one or more of those bad sectors, a lot of unpredictable things can happen. A spontaneous reboot is probably the least of those. But theoretically it could happen.

Operating system. This is truly the last resort. People frequently try to run an OS that’s either too new or too old to be ideal on a PC of a particular vintage. If the system is failing but all the hardware seems to be OK, try loading the OS that was contemporary when the system was new. That means if it’s a Pentium-133, try Win95 on it. If it’s a P4, try Windows 2000 or Windows XP on it. When you try to run a five-year-old OS on a new system, or vice-versa, you can run into problems with poorly tested device drivers or a system strapped for resources.

Another good OS-related troubleshooting trick for failing hardware is to try to load Linux. Linux will often cause suspect hardware to fail, even if the hardware can run Windows successfully, because Linux pushes the hardware more than Microsoft systems do. So if the system fails to load Linux, start swapping components and try again. Once the system is capable of loading Linux successfully, it’s likely to work right in Windows too.

Troubleshooting advice: When you suspect a bad component, particularly a power supply, always swap in a known-good component, rather than trying out the suspect component in another system to see if the problem follows it. The risks of damaging the system are too great, particularly when you try a bad power supply in another system.

And, as always, you minimize the risks of these problems by buying high-quality components, but you never completely eliminate the risk. Even the best occasionally make a defective part.