Steps to be done before selling your iPhone I was curious about the things that we need to do before selling your iPhone or even before giving it back to Apple (Apple has a program where they will refund you some money if you want to get a new iPhone). 

Quick googling show: 6 Steps to Prepare an iPhone for Sale the Right Way
.

I'm interested in all aspects. What to do in the iPhone itself, the associated Mac/iTunes and your account at Apple/iCloud.
Settings > General > Erase > Erase all content and settings

That will wipe it to factory