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 can push a notification for use with multi-factor authentication and it can provide codes for verification use when you do not have cellular or wireless access.
Refer to Microsoft's useful guides for full details about installing the app and adding your account(s):