Just a Warning: This will removal all data, music, photos, settings, literally everything, and the entire process is done from the iPhone without the need of using a computer. Back up before beginning if you need any of your personal data again, this will erase everything from your iPhone if you do not have everything backed up to the iCloud or a computer.
1. Launch “Settings” and tap on “General”
2. Scroll to the bottom of General and tap on “Reset”
3. Tap on “Erase All Content and Settings”
4. Enter the iPhone passcode if one is set, and confirm the reset by tapping on “Erase iPhone”