Warnings about a hard drive failure and the system locking up are both signs of impending doom. Replace the hard drive and reinstall from a backup before the system shuts down. If you do not have a backup plan, then now is the time to start, before the inevitable happens.
If the failure happens before that step is completed, then all important data will be lost. You do not mention the Windows version, but you can reinstall Windows from a Windows 10 media (if that is what is installed) but all important data will be lost.
I'm not an HP employee.
Did this message answer your question? Please indicate below as an Accepted Solution!
Did you find this message useful? Click on the "Was this reply helpful" Yes button.