While fastboot provides a way to bypass or erase a forgotten password, it's essential to manage passwords securely:
If you have an unlocked bootloader, these are the "best" commands to remove a lock (wipe data): fastboot erase tool password best
Instead of erase, many experts prefer format because it repairs file system corruption. Do not share device unlock tokens, OEM keys,
fastboot format userdata