Well, you may want to start again with a fresh install or you just want to sell your phone to someone without all your programs, settings, accounts, emails, calendar, contacts and so on.
To reset the phone, just go to the Settings, and go to the Privacy menu. Tap the option for Factory Data Reset. The phone will ask you to confirm, and then it will reboot, coming back as a fresh device.
After this, to completely wipe out any personal data stored on the phone, you may want to format the SD card. To do so, just go to the Settings and go to the SD card and phone storage menu. Tap the option to Unmount SD card and then hit the Format SD card.
That’s it, your phone is clean as new!