Step 1: Go to Settings > General > Reset.
Step 2: Tap Erase All Content and Settings.
Step 3: Enter your passcode if prompted.
Step 4: Confirm the reset – all settings and data will be deleted.
Step 5: iPhone will reboot and walk through setup screens to reconfigure.