I have (second hand from my daughter) an HP laptop that did the same. Tied everything I could think of, but a bios update from HP has 'almost' completely solved it.
Long/short. Ran very very hot and was shutting itself down regularly (almost daily), fan running at stupid speeds. Has now run continuously (never turned off) for a couple of months and is cool and quiet. It has shut itself down once in that period, which was due to heat I think. So not perfect but hugely better.