If you don't have your new Mac yet, you probably shouldn't be selling your old one yet. If you already have your new Mac on hand, you can transfer all of your data from your old Mac or use an older Time Machine backup. A completely fresh-from-scratch Mac is the best way to do this. If you leave behind anything that needs to be logged into with a password, that buyer will have to track you down and get your password to change ownership. It's a security and privacy thing for you, but it's also essential for the buyer. If you're about to sell your Mac, the one thing you don't want to do is give away the data you've been storing on it all these years. Clean the Mac of your personal data before erasing it
These directions are based on macOS 13 Ventura operating system. Here's how to reset your Mac before selling it or giving it away.