You always irritated when your PC always restart or shutdown during playing , making some web site search or office works .. you can pissed off when happen during the mid of your work .e,g presentation long typing words of doc and the only thing you forget is hitting a save icon/button so your work is down and get back to work again from scratch..
So I Decide to make a little explanation based in my experienced for almost 10 years as computer technician
first we category your PC or machine according to date manufactured,
You Can check your pc when date birth in the bios setting the first text appear when your computer start.
1) 5 years ++ old pc are very rare life span of the motherboard is on that line sometime 2 -3 years after you purchased symptoms show very often,,
2) 2-3 years old this the day you always encountered this problem
3) month - 1-year old
*** For The 5 years old PC if your machine still kicking
a.) check the power supply if the fan is still spinning clean it necessary
b.) check video card fan is still spinning at check it for hot surface in 5mins after start up
c.) check southbridge heatzinc add fan if needed
d.) clean memory golden feet and check it with memory test software HIREN software is optional ,pencil back eraser is the best for it,, make sure not to hard to scratch.
e.) check you hardisk noise if making unusual noise it cause for bad disk put in the HDD software and check for bad sector.
*** For 2-3 years old machine
a.) used in the first method to the last ..
b.) try to analyzed the cause of starting ,1st the power line down to to the output device connected to pc like usb thumdrive keyboard/mouse.
c.) if you buy your pc brand new from the store 3 parts usually causing for restarting it comes for the add ons card or not part of the motherboard,,
1.) power supply
2.) video card
3.) memory
4) hardisk
check this parts with software utilities
clean first from dust
rent or borrow this 3 parts from your friend to avoid wrong diagnose and save your time at cash.
***A Month old or 1 year pc is unexpected to show a symptoms of restarting.. 90% of this due for some dust around the fans of power supply. video card fan or a bad hardisk or bad sector..
a.) clean all the dust and check your components for liquid spilling that cause the short circuit check my post
http://rikkimortel.blogspot.com/2013/08/how-to-take-care-of-your-video-card-and.html
b.) re-sitted your memory to the memory slots
c.) hardisk bad sector check it with the software HDD, Seatools active boatdisk .use which one your suitable to use
Thanks for reading hope it helps