Having access to your recovery codes in a secure place will get you back into your account.
Use your saved recovery codes
Use one of your recovery codes to regain entry into your account. You may have saved these to a password manager, such as LastPass or 1Password.
At the bottom of the 2FA dialog, click Enter a two-factor recovery code to proceed using your code.
You'll be presented with a dialog asking you to enter your 2FA code, which will be generated from your TOTP application.