Step 1: Shut down computer completely and unplug the power cable.
tep 2: Pull off the side panel of your desktop.
Step 3: Check for dust around the CPU, CPU Heatsink, Northbridge (Should have some sort of small heatsink on it already, should be pretty easy to spot)
Step 4: Clean out fans, CPU area, and Motherboard of all dust (This can be done with a combination of canned air, compressed air [use a low psi air compressor], hurricane canless air, or vacuum with brush attatchment [vacuum should be used as a last resort only])
Step 5: Leave the side panel off for now. Plug computer back in and power up.
Most freezes, lock-ups, restarts, bluescreens are caused from too much dust in the computer which leads to too much heat on the CPU which causes the computer to shut down or restart out of "Self defense". Should this not solve your problem, please continue to Step 6.
Step 6: Shutdown computer and unplug.
Step 7: Take a flashlight and look at your motherboard. If the capacitors are bad, the will start to bulge around the tops of each cylinder. (Capacitors are usually cylindrical in shap and have some sort of symbol stamped into the top of each cylinder. These consist of, but are not limited to "I", "K", a large "+", or "A". If these have gone bad, they need to be replaced or you should look into a new motherbaord.
Step 8: Check to ensure all cables are connected properly and are not freely floating around the computer tower as small gaps and movement may cause "Gapping" between power connectors and this can cause sudden restarts.
If that does not work try
Step 9: Unplug everything from the Power Supply, plug the power supply into a power source (IE: the wall or a work bench) and test all of the connections with an amp meter or a circuit tester.
Step 10: Post results of tests so we can further diagnose (Please include specs) or Post which step worked. Good Luck