I think there’s a password reset thing if your account is linked to a phone number. They text you a SMS (this works for foreign numbers too). Otherwise you can enter your password to login
FYI what you’re supposed to do is transfer the account from the old to new phone before wiping the old phone. Password reset probably means you lose all of your messages