When we need to delete a user in Microsoft 365, There is an option to make the mailbox into a shared mailbox. You will not be able to login to that mailbox anymore, instead after converting the user mailbox to a shared mailbox, you can delegate another user with permission to that shared mail box.

optional step: When we delete a mailbox, by default the alias of that mailbox is deleted. If you want to delete the email address of the user (ie., [email protected]) we need to change the current mail address to an alias. And make the current Microsoft default alias ([email protected]) as the primary email.
select user==> account tab ==> click on "manage username and email" ==> under aliases click on the 3dot menu ==> select "change to primary email" (this will make Microsoft default alias to primary email address).

To delete a user:

  1. select user from active users list ==> click on delete
  2. Tick "email aliases will be removed"
  3. Tick "Give another user access to access to <user>'s email."
  4. click on "required:Give email access to another user"
  5. Assign another user to the mailbox.
  6. Click on Delete user.
  7. Select create a new display name , and set a Display name for the shared mailbox.
  8. if you don't want to send automatic replies. Untick send automatic replies dialogue.
  9. Click on transfer ownership.
  10. click on assign and convert.