You'll need to attempt to remember it up to 10 times. If you cannot guess it correctly the phone will factory reset. You can try ADM Android Device Manager from your Google account webpage, but that feature will no longer change the phone password from the webpage, it will only set up a password to unlock a lost phone. Still, stranger things have happened and worked that were not supposed to before.
Manage your T-Mobile account