Throw away any files which may contain sensitive data and securely empty the Trash.
If it shipped with Mac OS X 10.6.8 or earlier, connect its USB thumbdrive, restart the computer with the Option key held down, and click on the thumbdrive.
If it shipped with Mac OS X 10.7 or newer, restart with the Command and R keys held down.
Use the Disk Utility to erase the partition with Mac OS X installed, and then install a new OS onto it. If you used a thumbdrive, include it with the computer.