You can create restore discs on an HP by opening the start menu and searching for "Recover" Pick the one that says "Create Recovery Discs" or similar enough to it. You can only create one set of restore discs, after which it will delete the program, so make sure if you sell it to give the person you sell to, the discs.
The advantage of this is that you can first use a program to wipe the hard drive if there's any sensitive data (SSNs? Financial files?) on it that you may be worried that the buyer might use an "undelete" program to find the file on the hard drive. I recommend doing at LEAST two passbys with any such undelete program, but the federal minimum needed to wipe a hard drive that was a government hard drive is at least 7 passes - to really make sure the data is likely to be unrecoverable. After you delete the data, you'll boot from the first disc and run the recovery
On the other hand if you just care about doing it quickly, making it factory condition again while deleting all files (but not make them totally unrecoverable to those intent on finding them) you can just do the partition system restore. Turn off the computer and then turn it on. When it has the HP logo press f10 (it may be f12, if not f10... they like to change it up on HPs sometimes)(Usually I just repeatedly press the button to make sure it gets the input when it's ready to detect input) this should boot it from the recovery partition and allow it to restore back to factory condition by following the prompts.
The last HP 2000 I restored from the partition took about 2 and a half hours, so find something else to do while it does it.