What version of OSX are you running? What model of mac are you running it on? Did it come with recovery discs? If you upgraded OSX from the version that came with your Mac, do you have the CD (if it came on a CD)? Are you making regular Time Machine backups?
If you have a CD, (if you upgraded to Snow Leopard or bought a computer originally running SL or earlier with a CD drive) and it the CD appears on your desktop when you insert it, you should be able to reinstall from a Time Machine Backup, provided you have one. If not, things get a bit more complex. You should be able to buy the recovery CDs for your model from Apple (I think) or a third party. Note that recovery CDs only work with your EXACT model of Mac (e.g. a CD for a Macbook 2,1 won't work with a Macbook 3,1). If you're running Lion or Mountain Lion, I believe (this is pure speculation) that you can redownload the installer from the Mac App Store.
There's a sizable chance the above paragraph is entirely incorrect as none of it is based on personal experience, but rather several things I've read online.