To block a user from signing in to their Microsoft 365 account (for example, when an employee leaves or for security reasons), follow these steps in the Microsoft 365 Admin Center:
Go to admin.microsoft.com and sign in using your admin account.
In the left navigation pane, select Users, then choose Active users.
Find the user you want to block. You can search by name or email address.
Click on the user’s name to open their account settings.
In the user’s profile page, look for the "Block sign-in" option under the "Account" tab or section.
Click on "Block sign-in". A panel will appear asking you to confirm.
Choose "Block the user from signing in" and click Save changes.
You’ll see a confirmation message that the user’s sign-in has been blocked.
This means the user will no longer be able to log into Microsoft 365 services such as Outlook, Teams, SharePoint, or OneDrive.
Follow the same steps, and choose "Allow sign-in" instead of blocking.