When you do the setup, there's a special backup code given which you should put into a safe place (for example by printing it out and keeping it at home with your other important documents).
If you lose access to your 2FA app, you can use this backup code to gain access to your account.