Depends on the year of the compute and the software it is running. If it's a fairly recent Mac, it should have a solid state drive. You can find this out clicking the apple in the top left -> About This Mac -> Storage. If under the picture of the drive it says "Flash Storage" then it's an SSD. If so, this article should help:
Otherwise, if it says "SATA disk", you can follow this article:
Note: you would need to reinstall the computer with Mac OSX
Either way, it's a fairly complicated process. When I sold my MacBook Pro not too long ago, I took it to a third party computer repair place who wiped it then installed OSX for me. It was fairly cheap and well worth the security if knowing its being done right in my opinion.