Begin by backing up all your data on iTunes or iCloud and remove your SIM card and SD card before beginning the restore.
If you do not have a computer at hand and you are trying to fix a problem on your iPhone 4S that requires you to restore your computer to factory settings then follow these steps:
- Go to the Settings menu of your iPhone
- Tap on General
- Look for Reset and tap on it
- Tap on Erase all Contents and Settings
- You will find a pop-up box that will ask you to confirm if you really want to Erase All Contents and Settings. Tap on Erase iPhone on the box to begin the process of deleting all files, data and third-party applications from your iPhone.
Once the phone has deleted everything, it will restart like new. Set up your iPhone and restore backed up files from iTunes or iCloud.