If you reinstall from the original HP-provided disk(s), then you don't need to enter a product-key.
Contact HP, and order a replacement set of "System Recovery" DVD-disks (or a USB memory-stick),
and use that media to reinstall Windows.
Or, if your computer was running Windows 10, and it was (probably automatically) activated, you have a "digital entitlement" to download Windows 10, and to re-install Windows on your computer, without needing to enter a product-key.
HP Recovery Media is a set of DVDs and a CD, or USB stick, that will erase the hard drive (removing all data, settings, and applications, reinstall the original OS, drivers, and some HP Utilities. In some cases, you may be able to order a USB stick instead of disks. You have to order these from HP; they can not be downloaded.
Once there, input your Product name or number. On your Software and Drivers Download page, select your Operating System and and Version. Click "Update". If HP Recovery Media is available for your machine, down near the bottom of the page, you will see an entry for Order Recovery Media-CD/DVD/USB. Click the "+" symbol to expand that entry and click on Order Media for details.
Or, if you prefer, you can do the same by contacting HP Customer Service: