Sign in to the PS4 with the account you want to delete
Go to Settings
Select Login Settings
Select User Management
Select Delete User
Choose the account you want to remove
Confirm the deletion
If needed, delete the account from the PlayStation Network website separately
If the account is the primary PS4 user, deactivate the console first in Settings > Account Management > Activate as Your Primary PS4 > Deactivate
If you want to delete the entire PSN account, contact PlayStation Support
