the seller should have restored it to factory settings before they sold it to you. Also, you need the two disks that originally came with the mac, the disk with OS X and the other disk that has the applications on it. If you don't have them, order them from Apple before making any attempt at restoring.
You need the Original System Discs that came with that system. If they were not supplied by the seller then you will need to order them from Apple.
That system came with either Leopard or Snow Leopard and any other version of OS X that may now be installed is tied to the sellers Apple ID and you can not, and Should Not, use that.
Do you have the original installation discs that came with the computer? If so you only need to boot from the disc, erase the hard drive, then install Snow Leopard.
Upgrade Paths to Snow Leopard, Lion, and/or Mountain Lion
You can upgrade to Mountain Lion from Lion or directly from Snow Leopard. Mountain Lion can be downloaded from the Mac App Store for $19.99. To access the App Store you must have Snow Leopard 10.6.6 or later installed.
Upgrading to Snow Leopard
You must purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard - Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mountain Lion if your computer meets the requirements.
Snow Leopard General Requirements
1. Mac computer with an Intel processor
2. 1GB of memory
3. 5GB of available disk space
4. DVD drive for installation
5. Some features require a compatible Internet service provider;
fees may apply.
6. Some features require Apple’s MobileMe service; fees and
Upgrading to Lion
If your computer does not meet the requirements to install Mountain Lion, it may still meet the requirements to install Lion.
You can purchase Lion by contacting Customer Service: Contacting Apple for support and service - this includes international calling numbers. The cost is $19.99 (as it was before) plus tax. It's a download. You will get an email containing a redemption code that you then use at the Mac App Store to download Lion. Save a copy of that installer to your Downloads folder because the installer deletes itself at the end of the installation.
Lion System Requirements
1. Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7,
or Xeon processor
2. 2GB of memory
3. OS X v10.6.6 or later (v10.6.8 recommended)
4. 7GB of available space
5. Some features require an Apple ID; terms apply.
Upgrading to Mountain Lion
To upgrade to Mountain Lion you must have Snow Leopard 10.6.8 or Lion installed. Purchase and download Mountain Lion from the App Store. Sign in using your Apple ID. Mountain Lion is $19.99 plus tax. The file is quite large, over 4 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
Macs that can be upgraded to OS X Mountain Lion
1. iMac (Mid 2007 or newer) - Model Identifier 7,1 or later
2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) - Model Identifier 5,1 or later
3. MacBook Pro (Mid/Late 2007 or newer) - Model Identifier 3,1 or later
4. MacBook Air (Late 2008 or newer) - Model Identifier 2,1 or later
5. Mac mini (Early 2009 or newer) - Model Identifier 3,1 or later
6. Mac Pro (Early 2008 or newer) - Model Identifier 3,1 or later
7. Xserve (Early 2009) - Model Identifier 3,1 or later
To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
Are my applications compatible?
For a complete How-To introduction from Apple see Upgrade to OS X Mountain Lion.