(1) Back Up Your Data: Before you start, ensure that you have backed up any important data. You can save your game data to an external storage device or upload it to the cloud if you have a PlayStation Plus membership.
(2) Deactivate Your PlayStation: You don't want the new user to be able to access your PlayStation Network account. To prevent this, you need to deactivate your PSN account. Go to "Settings" > "Account Management" > "Activate as Your Primary PS4" > "Deactivate".
(3) Sign Out of Your Account: After deactivating your PSN account, you should sign out. Go to "Settings" > "Account Management" > "Sign Out".
(4) Perform Factory Reset: Now, you're ready to perform the factory reset. This will erase everything on the PS4 and restore it to its original settings. Go to "Settings" > "Initialization" > "Initialize PS4". You'll be given two options: "Quick" and "Full". The "Full" option takes a few hours but will ensure that none of your data can be recovered, so it's the best choice if you're selling your PS4.
(5) Follow the Prompts: After you select "Full", the PS4 will restart and the process will begin. Follow any further prompts to complete the initialization process.
Once the process is finished, the PS4 will be like it was when it first came out of the box. It will be ready for the next user to set up as their own.