Multifactor Authentication Methods
Office365 allows setting up multiple authentication-methods.
Push Notification
The default 2nd-factor authentication-method of Office365 is the push notification. It requires that you install the Microsoft-Authenticator app on a cell phone or tablet which must have an internet connection for logins to succeed.
Time-Based One-Time Password
TOTP is a convenient alternative to push-notification. An authenticator app displays a 6-digit code that is a second password for your account. It changes every 30 seconds.
The authenticator-app is usually on cell phone, but it doesn't need to be. There are authentication apps that run on Windows, Mac and Linux.
The TOTP method does not require that the authenticator app have an internet connection.