How to delete all data from an IPhone?

If you trade in your old IPhone Apple will give you a credit towards the purchase of a new 5S model so how can you remove data from the old phone and have it uploaded to the new phone?

Added (1). How do you back it up yourself, for instance is the data transferrable from your PC to the new iPhone, and how does the PC know what to upload?

When you get your new phone the store will transfer your files for you and you can then reset your old phone to factory. (the store will help you do that too)

They can show you the setting to delete all data from your phone. They did that for me when i traded my 4 for the 5

I would just back it up myself, then restore it to factory and take it in as that will wipe it clean.