Consider installing the official Microsoft Authenticator app on your smartphone. The Authenticator app is not required, but it is very easy to configure and use, and it is the recommended alternative to SMS text-based authentication. This app generates a code that you use with multi-factor authentication -- and it can provide codes even when you do not have Internet or wireless access.
Refer to Microsoft's useful guides for full details about installing the app and adding your account(s):
Related: Multi-factor Authentication