On the OLD computer, you want to do two steps:
1) use Disk Utility ERASE everything. all your personally identifiable information, MacOS tagged with your Apple-ID, and your Paid Applications will be removed. However, that leaves the computer in very limited state.
2) unless you HATE the next recipient of the computer, it is considered polite to download and Install the originally-issued MacOS, which can also be done from Recovery. The originally-issued MacOS is tagged only with the serial number of the computer, and NOT your Apple-ID.
Once installed, you can try it out, but do NOT enter a new userid. At that point, quit Setup Assistant and Shut Down the machine, so that the next Owner can set it up for themselves. Do Not Install the latest version of MacOS, because all those versions are tagged with your Apple-ID.