As it is an HP laptop you have both memory and hard drive tests built into the bios. To access you need to:
Power on your PC, press Esc, then F2 at the prompt. Choose System Tests (Fast Test performs a 4 minute hardware check).
If anything fails please post the result.
If the hard drive is failing it could be cause of your problem. Also if you upgraded from an earlier version of windows to windows 10 then the factory recovery will not work as it will be trying to load the earlier windows version. You would need to download a windows 10 image for flash drive and make up the install media.