Before you take the steps below, questions:
- did you ever "sign this out" of iTunes?
- did you ever "sign it out" from iCloud?
If not, do you have another Apple device from which you could use to accomplish this task?
- another Mac?
- an iOS device?
I would try to get it signed out before "wiping" it.
Otherwise, if you "pass it on" to someone, that person may find he/she is still "stuck with" your old Apple accounts (instead of being able to establish their own)
Having said that...
Try this:
Boot to INTERNET recovery (NOT THE SAME as "the recovery partition"):
Command-OPTION-R
at boot.
You'll need your wifi password.
The internet utilities take a while to load, so be patient "as the globe spins".
When you get to the utilities, open disk utility.
VERY IMPORTANT STEP:
Go to the "view" menu and choose "show all devices".
Now look at "the list on the left".
The topmost item is the physical drive inside.
Click on it and click "erase".
I believe the installer is going to offer you OS 10.15 (which needs APFS), so...
Choose to erase to "APFS, GUID partition format".
When the erase is done, quit disk utility and open the OS installer.
Start clicking through. The Mac will restart one or more times, and the screen may "go dark" for a minute or more. Be patient.
When done, you should see the initial setup screen (choose your language).
At this point, if you're going to sell it or give it away, I would just hold down the power button continuously until the display goes dark and the Mac shuts off.
It's ready to "hand over."
The next user will see the setup screen upon bootup (just as if it were new).