Problem of restarting and unforeseen system off issue is occurring in front of many users that can be easily predictable and solved by implementing following steps:
1. Firstly check windows is properly install or some windows file missing during installation .Some time due to improper shutdown and virus problem is corrupt your file system that may cause missing of file from your hard disk.
2. Remove processor from motherboard and then after, properly fit processor on motherboard.
3. Check processor fan that can be properly mounted on processor or not.
4. Check RAM by replacing it by another RAM having same FSB . Some time this problem is occur due to the compability issue when RAM FSB is not supported by motherboard .So, you can check your motherboard RAM FSB that can be supported by your motherboard or not e.g. 533 ,667,800 MHz FSB and also check capacity of per channel of RAM slot.
5. If your hard disk produce some noisy sound and hanging problem is occur than change your HDD. Some times bad sectors cause restarting problem.
6. Some time unforeseen system off is occur due to power supply problem.If, you are performing high processing work than after few minutes your computer is off this shows internal problem of SMPS and then check it by replacing another SMPS.