When laptops are sold by HP they come with an OEM Windows 10 operating system.
Once the operating system is updated licensing data is entered into Microsoft servers.
Once licensing data is entered into Microsoft servers this enables clean installs or disk drive replacements.
At any time you can perform a factory reinstallation with cd/dvd or flash drives.
When factory installs are performed all files on the computer are removed so it is important to backup files.
It is always best to make free backup images before making major changes so that if there are any unexpected problems an image can be restored.
(Acronis, Aoemi, EaseUS, Macrium, Paragon,etc.)
There will be DVDs with the operating system and DVD with drivers and applications.
After the installation download and install the HP driver and support assistant:
https://support.hp.com/us-en/help/hp-support-assistant
Use the HP support assistant to update the drivers and BIOS.
Install applications as needed.
Other applications to install:
HP UEFI hardware diagnostics: https://ftp.hp.com/pub/softpaq/sp143501-144000/sp143798.exe
HP Windows hardware diagnostics: https://ftp.hp.com/pub/softpaq/sp144501-145000/sp144583.exe