Follow these steps.
Disclaimer: If you enter the wrong passcode on an iOS device six times in a row, you'll be locked out and a message will say that your device is disabled.
The first step in getting back into your iPhone is resetting your iPhone.
Unless you made a backup before you forgot your passcode, there isn't a way to save your device's data. You'll need to erase your device, which deletes all of your data and settings. Choose a way to erase your device so you can remove your passcode:
- If you've synced with iTunes, use iTunes.
- If you can't sync or connect with iTunes, use recovery mode.
Erase your device with iTunes to remove your passcode
If you've synced your device with iTunes, you can restore your device. This will erase the device and its passcode.
How to steps
1. Connect your phone to a computer you have synced with before.
2. Open iTunes. If asked for a passcode, try another computer you've synced with, or use recovery mode.
3. Wait for iTunes to sync your device and make a backup.
4. After the sync and backup have finished, click Restore
5. When you reach the setup screen while restoring your iOS device, tap Restore from iTunes backup.
6. Select your device in iTunes. Look at the date and size of each backup and pick the most relevant one.
Erase your device with recovery mode to remove your passcode:
If you've never synced with iTunes or set up Find My iPhone in iCloud, you'll need to use recovery mode to restore your device. This will erase the device and its passcode.
- Connect your iOS device to your computer and open iTunes. If you don't have a computer, borrow one from a friend, or go to an Apple Retail Store or Apple Authorized Service Provider.
- While your device is connected, force restart it:
- On an iPhone X, iPhone 8, or iPhone 8 Plus: Press and quickly release the Volume Up button. Press and quickly release the Volume Down button. Then, press and hold the Side button until you see the recovery-mode screen.
- On an iPhone 7 or iPhone 7 Plus: Press and hold both the Side and Volume Down buttons at the same time. Keep holding them until you see the recovery-mode screen.
- On an iPhone 6s and earlier: Press and hold both the Home and the Top (or Side) buttons at the same time. Keep holding them until you see the recovery-mode screen.
- When you see the option to Restore or Update, choose Restore. iTunes will download software for your device. If it takes more than 15 minutes, your device will exit recovery mode and you'll need to repeat steps 2 and 3.
- Wait for the process to finish. Then you can setup and use your device.
Some resources were found on Apple's website | Click Here to view