Assuming it is the Maverick OS....
Scroll down on this link and follow the directions there for doing a clean install.
Help to do Clean install OSX Mavericks: Apple Support Communities
Here is a small excerpt from that link above:
.........Warning: Performing a format and clean install of OS X will erase the Macs hard drive and all contents on the drive will be removed. All files, applications, documents, photos, customizations, everything on the computer will be lost in this process. Understand this and know what you are doing, and why, to prevent data loss of critical files. We can not reiterate this enough.
How to Format & Clean Install OS X Mavericks on a Mac
You will need a bootable OS X 10.9 installer drive to accomplish a clean Mavericks install using this method. You can learn how to easily create one here if you haven’t done so yet...........