It appears you were reading the correct article linked at the top left of this page which I'm linking here again:
https://support.apple.com/HT212190
Go to the section titled "Start up from macOS Recovery" which will have you boot into recovery mode where you will then follow use the command line to issue a "resetpassword" command.
FYI, here is an Apple article on how to prepare a Mac for sale or giving a Mac away as this will disassociate your AppleID and accounts from the laptop and also will destroy all data on the internal SSD so the new user won't have access to any of your personal files and the new user will have a factory fresh experience when they get the laptop:
What to do before you sell, give away, or trade in your Mac - Apple Support