How to factory reset your iPhone, iPad or iPod touch
Find out how to erase information from your iPhone, iPad or iPod touch and restore your device to factory settings.
If you also need to securely erase your Apple Watch, unpair your Apple Watch.
Create a backup
Back up your device so you can restore your content, settings and apps to a new or erased iPhone.
Erase and reset your device
Go to Settings.
Tap General.
Tap Transfer or Reset [device].
Tap Erase All Content and Settings.

Tap Continue.

Choose to keep or delete your eSIM. If you erase your eSIM, you need to contact your carrier to reactivate your mobile plan.

Enter your device passcode. Forgot your passcode?
Wait for your backup to finish.
Enter your Apple Account password. Forgot your Apple Account password?
Tap on your keyboard.
Wait for your device to reset.
When the process completes, the Hello screen is displayed.