Easy.
Go into Settings / General / Reset / Erase All Content And Settings
This will do a secure wipe, usually takes an hour or more.
After that you should do a full restore in iTunes.
I'd also suggest you jailbreak it if your going to put it on Ebay as well.