there could be many thing:
software wise (OS, application, malware, etc)
Hardware wise (heat, cold, dust, electricity, dust, etc)
to see if it is indee hardware:
go to bios, check the temperature s it over heat (usually over 60-70 celcius)
still in bios, see the electricity output, is it not fluctuated much (over 0.25-0.35 volt).
if it is about heat, you must realize that probably some of your components might be burn, check if the tube thing in your mb not "pregnant".
the solution to over heat is just give space for each of your components (hdd, cards, etc) and add some fan with good inflow-outflow management.
if it is about electricity, the best thing is to buy ups, but if you can't afford it try using stabilizer with motor. try also check your psu, whether it is a good brand (like simbadda, enlight, etc). because the cheap psu is not stable on its dc output.
also check out your ram, try to clean its gold bar, if it is dusty.
for the hdd integration try to do scandisk on it in case you'll have new bad sector.
also check out your vga, nowadays vga need more electricity when in full power than the older generation. that can also make your psu unable to support the electricity output. the solution is just to have the higher watt psu.
for the software test.
try to take off your hdd and make it a slave to other hdd in other computer and scan it using the latest updated av database.