Many people panic when they forget their phone passwords that have been unlocked, thinking the phone is now useless. You can bypass it, and normalize things.
Google also tightens your phone 's security, making it hard to get back to your phone with new Android versions, but there's always a way to make your phone accessible again, as if you know the username and password of your Google account.
If you are using modern version of Android, this means that there’s no built-in way to simply reset your pattern, PIN, or password and gain access to your phone or tablet. This is because Android removed the feature that would enable you do that.
The only thing that can save you now is the Android smart lock feature. When you set up Smart Lock on your Android phone and have it automatically log in when it’s on your home Wi-Fi. Then you can take your phone to that home Wi-FI network and it will automatically unlock for you, even if you can’t remember the normal unlock code.
Other tricks that might work; let’s say for example if you are using a Samsung device, when logged into the device with a Samsung account, you can go to the Samsung Find My Mobile website and log in with the Samsung account, and use the “Unlock my screen” option to remotely remove your device’s lock screen.
If you are using Android 4.4 and below first enter an incorrect pattern or PIN five times at the lock screen then you’ll see a “Forgot pattern,” “forgot PIN,” or “forgot password” button appear. Then you’ll be prompted to enter the username and password of the Google account associated with your Android device.
What if all the above methods fail? Don’t panic! You can still get your device into a usable state again, but that will involve performing a factory reset, wiping the device’s storage, and setting it up again from scratch.