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 original thumbdrive and restart the computer with the Option key held down.
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 fresh OS onto it.
Include the disk with it, or press the Option key as well when restarting from the recovery partition.