If you want to perform a master reset, follow these steps:
- All of your crucial data should be backed up to iCloud or iTunes.
- Reset the device by going to the Settings-> General-> Reset menu.
- Erasing all content and settings is the option to choose.
- To continue, enter your device passcode if requested.
- To confirm the iPhone reset, tap the choice.
When the reset is complete, your iPhone will reboot. You may start and finish the first setup procedure when it boots up. Connect to your Wi-Fi network after enabling Wi-Fi.
You may also restore factory settings on your iPhone using iTunes.