Hi,
Welcome to the Microsoft Q&A platform!You can try to use automated tool to troubleshoot the issue:Support and Recovery Assistant for Microsoft 365
Out-of-date software and corrupted Outlook profiles are two of the most common issues.
Make sure your outlook version is up to date! And you can try to create a new Outlook profile to see if this works. You can refer to:Create an Outlook profile
More information about this issue you can refer to:Fix Outlook connection problems for Microsoft 365 account
Please feel free to contact me for any updates. And if this helps, don't forget to mark it as an answer.