Greetings,
Welcome to the forum.
I am not a HP employee.
You should back up data ASAP and replace the failing HDD.
You will have to reinstall the operating system (OS) and all additional software unless you make OS disk images. OS disk images require boot recovery media to restore the recovery image to the new HDD or SSD.
Regards