There is no specific way to reset a Mac to factory settings. If you erase its hard drive and reinstall the operating system it should be good to go. Just remember to sign out of iCloud otherwise it will remain locked to your account.