Sign out of your icloud account first before you delete or format anything, otherwise the next user could run into issues, even after a format or wipe. After you sign out you can use a mac system reset to wipe the computer. If it's a solid state drive than that should do, if it's a spinning drive you might feel you need to wipe it but reinstalling a macos on an empty drive could be an issue.