If you encountered this problem, that’s probably your microsoft account have 2FA mechanism. To solve this issue, please visit Office 365 Support about create an app password (this is not recommended)
https://support.office.com/en-us/article/Create-an-app-password-for-Office-365-3e7c860f-bda4-4441-a618-b53953ee1183