When you are in Home screen, then select Settings.
Now goto General.
Then select Reset.
Afterwards choose from the menu option: Erase All content and Settings.
If prompted, enter the 4-digit passcode.
In the end accept option Erase iPhone.
Third method for iTunes version 10:
First you should unplug your phone from the computer, but leave other end of USB cable connected to the computer.
Next press the Sleep / Wake button on your iPhone for few seconds until the 'slide to power off' switch appears.
Slide the slide to power off switch right to power off the device.
Now hold and press the Home button, then connect the iPhone to the computer via USB cable.
* When you can see connect to iTunes info, then ou can be release once the Home button.
* Open the iTunes application on the computer, if iTunes does not open automatically.
Confirm information from iTunes about Recovery mode, and click OK.
From iTunes, click Restore.
Fourth method for iTunes version 11 or higher:
Please connect your iPhone to the computer or laptop via USB cable.
Then you should open the iTunes application.
Click iPhone (located in the upper-right).
Now select Restore iPhone.
Check the iTunes alert message.
Next click Restore and Update.
Afterwards choose Next.
Now the process will take few minutes -> please be patient.