If you're having issues connecting to Office 365, below are the three most common things to check.
Troubleshooting Office 365
1) Two-Factor Authentication
-Do you use a PIN code to log in? If so, see this guide for more information here.
2) IMAP Settings
-Check to see if IMAP is enabled under your account settings.
3) Ask Your Network Administrator
-Reach out to your email provider or work admin/IT to determine if IMAP is enabled on your account.