How do I reset my PS4 to sell?

Perform a factory reset from Safe Mode
  1. Turn your PS4 fully off. Don’t set it to Rest Mode. …
  2. Hold down the power button until you hear two beeps. …
  3. Choose the reset option you need. …
  4. If you’re not having software problems, pick Initialize PS4.

Can you reset a PS4 back to factory settings?

To restore system software to its default settings, select (Settings) > [Initialisation] > [Restore Default Settings], and then follow the on-screen instructions.