Restore your iPhone, iPad, or iPod to factory settings

A factory restore erases the information and settings on your iPhone, iPad, or iPod and installs the latest version of iOS, iPadOS, or iPod software.

Important Note for FirstStar Program iPads
If you backup your iPad and restore the backup, it will restore the FirstStar restrictions. You must backup any files you wish to keep to the cloud before performing a factory reset. This process will only work for FirstStar graduates that have arranged to have their iPad released by contacting the FirstStar office.

Get your device ready

  1. Make sure your Mac or PC is updated. If you're using iTunes, make sure you have the latest version. If you can't access a computer and your device still works, you can erase and restore your device without a computer.

  2. If you want to save the information on your iPhone, iPad, or iPod, make a backup.

  3. Go to Settings > [your name] > iCloud, tap Find My iPhone, then turn it off. For an unresponsive device or one that won't turn on, learn what to do. If you forgot your passcode, get help.

Restore your device to factory settings

  1. On a Mac with macOS Catalina 10.15, open Finder. On a Mac with macOS Mojave 10.14 or earlier, or on a PC, open iTunes.

  2. Connect your device to your computer. 

  3. If a message asks for your device passcode or to Trust This Computer, follow the onscreen steps. If you forgot your passcode, get help. 

  4. Select your device when it appears on your computer. For an unresponsive device or one that won't turn on, learn what to do. Or get help if your device doesn't appear on your computer.

  5. Click Restore [device]. If you're signed into Find My, you need to sign out before you can click Restore.

  6. Click Restore again to confirm. Your computer erases your device and installs the latest iOS, iPadOS, or iPod software.

  7. After your device restores to factory settings, it restarts. Now you can set it up as new.

Original Source: https://support.apple.com/en-us/HT201252