Is it an AMD CPU ? I’ve had 2 computers shutdown kind of like that and they were just overheating. I put new thermal grease between cpu and fan and blew them out with air which fixed them. just my 2 cents