Back to Factory settings except one folder
First back up to a USB what you want to keep.

Then follow instructions from Apple how to ready your Mac.

Do not forget to Log out from iCloud, iTunes, App Store...ect..