Macbook Pro shutting off while booting up.
Okay so I've been having a lot of problems with my 2010 macbook pro. Apparently it will start up and then after a couple of minutes, doing something simple, like use the web or the like, it will completely cut out and then refuse to go back on again. It will start up after a few hours but then the whole thing will start all over again. I've done everything to try and fix this such as resetting the PRAM and SMC but nothing works. I assumed it was a fault with my main hard drive and completely wipped it. I went to reinstall the Mac OS and got as far as restarting when my macbook will just completely shut down and not go back on again.
I really don't know what could be causing this or why. I've basically tried everything there is and noting appears to be working. Can somebody give an answer or tell me what may be causing this problem please.
~VIN,MacBook Pro (15-inch Mid 2010), iOS 11.2.6