I wouldn't do that.
I'd first manually de-authorize it from iTunes, etc.
Then, sign out of iCloud.
Then, erase the internal drive and install a clean copy of the OS onto it.
It would help if you told us
WHICH Mac
What year made
What version of the OS is on it.