1. Go to Settings - General - Reset - Erase All Content and Settings;
2. Connect the iPhone to iTunes - choose Restore iPhone. Or, put the iPhone into recovery mode and then use iTunes to restore;
3. Turn on Find My iPhone and connect the iPhone to a Wi-Fi network. Next, log in to your iCloud account to locate Find My iPhone to erase everything on the iPhone;
By the way, the last three methods can also be used to factory reset an iPhone when forgetting the passcode.
Resetting a phone or any electronic device is sometimes needed when the device’s user needs to erase unwanted apps or things like that. There are several ways to reset an Iphone. One way is the use the iCloud. First, you need to back up the items that you want to save and you do not want erased. You can go to settings to do that. Then on the settings menu, there should be a reset button after clicking the general tab.
One option that should be displayed is to erase all content and settings. Clicking on this will erase what you have on your cell phone that you did not back up first. It will reset at this point to the way the factory had it when it was shipped to the store.