You have to start with Snow Leopard:
Requirements for OS X 10.6 'Snow Leopard'
Whilst Apple have withdrawn Snow Leopard from their stores, you can still get it from Apple by calling 1-800-MY-APPLE (if you are in the USA) and they will supply the SL DVD for $20 for a single user, or $30 for a family pack that covers up to 5 Macs. You can also purchase the code to use to download Lion from the same number.
If you are outside the US call your national Apple Helpline:
If you're in the UK, use this number: 0871 508 4400
When you have installed it, run Software Update to download and install the latest updates for Snow Leopard.
Get more information about your computer. Go to the Apple in the upper left corner of any window, then "About This Mac". Write down what it says about "version"and report that here. Now continue to "More Info..." Copy and paste the information here, but omit the serial number and Hardware UUID (if present).
The main thing is if your computer can run ML. For that you have to compare the specification from the above with the second link below. Also note that even if you can, you may well need to buy more RAM (:memory") for your computer. While you can run with minimum it often won't work well.
Upgrading to Mountain Lion - http://www.apple.com/osx/how-to-upgrade
Mac OS X: System requirements for Mountain Lion (10.8) - http://www.apple.com/macosx/specs.html
Lion and Mountain Lion application compatibility - http://roaringapps.com/apps:table
Kappy 08/2012 post on upgrading to Snow Leopard, then Lion or Mountain Lion - https://discussions.apple.com/message/19401628 - including how to get Snow Leopard and Lion since Apple removed them from the online store.