That depends. If you do not want to lose your previous data, I suggest using the Android bypass tools available, but it needs a subscription though. Or if you are thorough in your monthly backup, I suggest factory resetting your mobile which differs with each phone model.

I can give an example for the Samsung model.
1. Press the power button and lower part of the volume button simultaneously
2. When the screen blanks out, immediately stop pressing the lower volume button and press the upper half button with the power button.
3. It shows you the settings like reboot, restore, etc etc
4. For navigation, use volume buttons. For selecting, use the power button
5. Select the factory reset
6. Then select reboot

Tada! Then it asks for the password, just sign in with Google account instead.