Getting rid of an old Mac
First, before you forget it, deauthorize iTunes. Apple limits iTunes purchases to use on 5 computers at a time - if you sell one without deauthorizing it, you're down to four...
In iTunes, go to the Advanced (or Store in recent versions) menu and choose Deauthorize Computer.
Copy the hard-drive contents
Hard drives are cheap - data isn't. Copy your data onto another storage device. Carbon Copy Cloner works well for this.
Erase the hard drive
Erase the hard drive to keep your private data private.
Boot from a Mac OS X installation disc and wipe the drive. Be sure you have a full set of installation discs. To start up from an installation disc hold down the "C" key as the computer starts up. From the Utilities menu, choose Disk Utility. Select the hard-drive icon in the left column. Click the Erase tab. Click Security Options. Choose from Zero All Data, 7-Pass Erase, or 35-Pass Erase (if you're really really paranoid). Name the newly erased drive and click Erase.
Install OS X from the installation discs
Then run Software Update to get the latest upgrades.
Pass it on
Auction sites often require that the operating system that's installed on the computer comes with discs.
If you include software that didn't come with the computer, hand over the original discs or installers and serial numbers of the software to the new owner. Keeping a copy for yourself is piracy ya know.