If you have forgotten your iPhone password, you can access your phone with iTunes Backup and Restore or by putting it into recovery mode. If your device is running Android 4.4 or earlier, you have the option to reset the login sequence with your Google account. If you are no longer able to log into your account, you can restore the device to factory conditions. To use Android 5.0 and later mobile phones again, you need to erase all the data they contain.
Steps
Method 1 of 4: Android 5.0 and Later

Step 1. Open the Android Device Manager page in a browser
This method leads to the deletion of all the contents of the phone. Starting with version 5.0 of the operating system, Google has eliminated the ability to bypass the passcode without formatting the device. You will be able to use your phone again, but you will lose all data (such as photos and music) stored inside.
- This method only works if you have enabled Android Device Manager on your phone.
- If you are unable to unlock your phone using these steps, learn how to reset it to factory settings.

Step 2. Log into your Google account
Use the same profile associated with the phone.

Step 3. Select your phone from the list
If you have associated more than one Android phone with your Google account (for example models you no longer use), you will see a list of devices to choose from.

Step 4. Press "Delete"
Remember that this method deletes all data saved on the device.

Step 5. Press "Cancel" again to continue
The device will return to factory settings. It will take several minutes to complete the operation.

Step 6. Follow the on-screen prompts to set up your phone
The operation is similar to that for new mobile phones.

Step 7. Open the Settings menu
Once setup is complete, the home screen will open; create a new passcode or sequence.

Step 8. Press "Security"

Step 9. Press "Screen Lock"
Choose the type of lock you want to use, then follow the prompts to create the new code.
Method 2 of 4: Android 4.4 and Earlier Versions

Step 1. Try to unlock the phone five times in a row
This method only works if you have set a login pattern on Android 4.4 (KitKat) or earlier. After five unsuccessful unlocking attempts, the message "Forgot your pattern?" Will appear.

Step 2. Press "Did you forget the sequence?
. You will have the option to log into the phone using your Google account.

Step 3. Enter your Google account information and press "Sign in"
If the username and password are correct, the mobile will unlock.

Step 4. Open the Settings menu
After logging in with your account, the previous lock pattern will be disabled. Now you can create a new code that you won't forget.

Step 5. Press "Security"

Step 6. Press "Screen Lock"
Choose the type of lock you want to use, then follow the prompts to create the new code.
Method 3 of 4: Using iTunes Backup and Restore

Step 1. Connect iPhone to iTunes
If after six attempts you have not been able to unlock it, you will see the message "The device is disabled". To regain access to your mobile, connect it to the computer you are using iTunes on, then open the program.
- If you see the message "iTunes cannot connect to [your device] because it is locked with a passcode" or "You have not authorized this computer to access [your device]", try a different computer that you have already synced to.
- If you don't have another computer available, read Using iPhone Recovery Mode.

Step 2. Sync iPhone with iTunes
If your phone is set to auto sync, this should start by itself. If not:
Click on the phone

Step 3. Click the "Sync" button at the bottom of iTunes

Step 4. Click "Restore iPhone
.. to start the backup recovery operation. Now that you have created a backup copy of the contents of your phone on your computer, you can restore your phone to its original settings. Once the restore is complete, the Setup screen will appear on the iPhone.

Step 5. Follow the prompts until you get to the Applications & Data screen
The steps will guide you in setting up the iPhone as if it were new. You will need to choose your location, connect to Wi-Fi and create the new passcode. Once you open the Applications screen, you will have the option to restore the backup.

Step 6. Select "Restore from iTunes Backup"

Step 7. Press "Next"
The following steps must be completed on the computer, from iTunes.

Step 8. Select your iPhone in iTunes
Click on the phone icon in the upper left corner to do this.

Step 9. Select "Restore Backup"

Step 10. Choose the most recent backup
If you see more than one file, be sure to choose the one with today's date.

Step 11. Follow the prompts to restore iPhone
When finished, all data will be copied back to the phone.
Method 4 of 4: Using iPhone Recovery Mode

Step 1. Connect iPhone to iTunes
If the phone has been locked after several failed login attempts, you will see the message "The device is disabled". This method leads to the deletion of all data contained in the mobile, so only try it if you are unable to access the iPhone using iTunes Restore.
Contrary to the backup and restore method, you can complete these steps on any computer that has iTunes installed (not necessarily the one you synced to)

Step 2. Press and hold the Sleep and Home buttons
Keep pressing them until the recovery mode screen appears. You should see the display go black with the iTunes logo and a USB connector, which suggests connecting the device to your computer.

Step 3. Click "OK" in the window that appears on iTunes
A pop-up should open with the following text: "iTunes has detected an iPhone in recovery mode. You must restore the iPhone before you can use it with iTunes". Otherwise, go to the next step.

Step 4. Click "Restore" on iTunes
You will see the button in the window containing the "Cancel" and "Update" items. After clicking, iTunes will start the restore operation, which can take several minutes.

Step 5. Follow the directions on the phone
When the reset is complete, the iPhone will restart. Follow the prompts to set your location, set up your Wi-Fi network and create your new passcode.
- If you have created an iCloud backup in the past, select the "Restore from iCloud Backup" item on the "Applications & Data" screen.
- If you don't have a backup available, select "Set up as a new iPhone" on the "Apps & Data" screen.