I understand that you are experiencing sudden restarts and your computer is getting very hot. This is an indication of your Notebook overheating, I am providing you with an HP Support document: Reducing Heat Inside the PC to Prevent Overheating. This document has been designed to address the exact issue you are describing.
I would advise you to review and follow the instructions to resolve your overheating issue. Thank you for posting on the HP Forums. Have a great day!
Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
Dunidar I work on behalf of HP
Find out a bit more about me by checking out my profile!
"Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter