In Microsoft 365 admin center go to Active users > select user > Mail tab > Manage email apps.
Outgoing server
Server name: smtp.office365.com
Port: 587
Authentication method: OAuth2
Connection Security: STARTTLS
Incoming server
Server name: outlook.office365.com
Port: 993
Authentication method: OAuth2
Connection Security: SSL/TLS