If your PC did not originally come with W10 from HP, during the installation process, you will need to select the version of W10 you need to install, and then when you are asked to enter a product key, select the 'I don't have a product key' option, and W10 will install and automatically activate once you are connected to the internet.
After W10 has completed installing, you can install the drivers and available software from your PC's support page, as applicable.
After you remove the drive, you can buy a SATA to USB cable, plug one end into the failed drive and the other end into a working PC's USB port and see if you can read/copy any files from the failed drive to the PC.
It is highly unlikely though but you only have a few bucks to lose by trying it.
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".