How do I wipe my iPhone ?

Guys sorry if this has been discussed as I am a newbie , I bought an iPhone but I'm gonna go return it to trade in for an iPhone 3gs . How do I wipe my phone to get rid of all the emails and all my apps so that it's back to factory state when I return it .
just do a restore as new. and under the "Info" tab in iTunes, deselect your contacts, email, etc... there are also some options on the iphone under settings to wipe your bookmarks, cache, dictionary, etc.. just tap Settings > General > Reset > Erase All Contents and Setting.
he's right, but for future reference you might post in the help section

http://forum.theiphoneblog.com/iphone-help/

Original thread: https://forums.imore.com/threads/how-do-i-wipe-my-iphone.182450/