If you forgot your iPhone passcode, the only thing you can do with your device is to make an emergency call. Besides, if you enter the wrong passcode too many times, your iPhone will be disabled and you can only enter the password after 1 minute, 5 minutes, 1 hour...
Thus, if you can't remember your password, you will need to erase your device, including the lock-screen password, so that you can use your device again.
Any way to unlock your iPhone without a password will erase all the data and settings on your device. Therefore, unless you backed up the device before, you will lose all the data and settings on your iPhone since data recovery is hardly possible to restore your iPhone data.
Besides, you need to remember the Apple ID and password you used on the device, or you won't be able to use the device.
The solution that comes into your mind first to unlock an iPhone when you forgot the password may be using iTunes. Yes, with the help of iTunes, you can remove your iPhone password by erasing your device. Afterward, you can set up your iPhone and set a new passcode for your iPhone.
To unlock your iPhone via iTunes:
Step 1. Make sure your iPhone is not connected to your computer and turn off the device.
Step 2. Put your iPhone into the recovery mode.
Step 3. Wait for iTunes to launch automatically and choose "Restore" in the window to restore your iPhone, which will erase the device.
Step 4. Set up the iPhone.
If you made a backup of your iPhone before, choose to restore your data from an earlier iTunes or iCloud backup in the Apps & Data screen.
What to do if you forgot your iPhone passcode? As mentioned, you need to erase your device to remove the passcode so that you can use the iPhone again. Apart from using iTunes, there are other ways available for you to unlock your iPhone without passcode, including using a third-party iPhone unlocker tool, like EaseUS MobiUnlock.
With such a tool, you don't need to manually enter the recovery mode as you use iTunes. Just follow the onscreen instructions in EaseUS MobiUnlock and then you can factory reset your locked iPhone easily. Whether it's four-digit code, six-digit code, Touch ID, or Face ID, EaseUS MobiUnlock will remove it for you.
To unlock an iPhone when you forgot the passcode:
Step 1. Launch EaseUS MobiUnlock and connect your disabled iPhone or iPad to the computer. Then, click "Start."
Step 2. Make sure your device model is the one you wish to unlock and then download an appropriate firmware for your device by clicking on "Download Firmware." (If the firmware has been downloaded already, select it instead.)
Step 3. Click on "Verify Firmware" to comfirm.
Step 4. Then, enter some needed information in the new pop-up warning window. Once you're done, proceed by clicking on "Unlock."
Step 5. After a few second, your disabled iPhone or iPad will be unlocked successfully.
Afterward, set up your device and create a new lock screen passcode.
Using iCloud is helpful on condition that you have enabled Find My iPhone before you forget the iPhone passcode. By visiting iCloud.com, you can erase iPhone remotely. And by doing so, you can remove the password to unlock your iPhone.
To remove the passcode via iCloud:
Step 1. Go to iCloud.com and enter your Apple ID and password to sign in.
Step 2. Choose "Find iPhone" and go to "All Devices" > "Erase iPhone".
There is a trick to unlock your iPhone without passcode, which is to use Siri. However, this tip is not applicable to all iPhones. For more details, refer to the guide on how to bypass iPhone passcode.
Conclusively, there are two commonly used ways to get into a locked iPhone without password: You can either apply iTunes or third-party utility. Using iCloud is workable only when you have turned on Find My iPhone on the device.
Besides, it's worth stressing that removing the lock screen passcode doesn't remove the Apple ID and password you use on the device. To use the iPhone again, you still need to remember the Apple ID account previously used on the iPhone.