Hi @Eaven HUANG
You could refer to the below guide introduced by the official document:
Overview: Remove a former employee and secure data
Step 2 - Save the contents of a former employee's mailbox
Once you've blocked a user from being able to log into your organization you can save the contents of their mailbox. There are two ways you can save the contents of the former employee's mailbox.
Place a Litigation Hold or In-Place Hold on the mailbox before the deleting the user account. This is much more complicated than the second option but worth doing if: your Enterprise plan includes archiving and legal hold, litigation is a possibility, and you have a technically strong IT department.
After you convert the mailbox to an "inactive mailbox," administrators, compliance officers, or records managers can use In-Place eDiscovery tools in Exchange Online to access and search the contents.
Inactive mailboxes can't receive email and aren't displayed in your organization's shared address book or other lists.
To learn how to place a hold on a mailbox, see Manage inactive mailboxes in Exchange Online.
OR
Add the former employee's email address to your version of Outlook on Desktop, and then export the data to a .pst file. You can import the data to another email account as needed.
And the thread here discussed the similar question: What's the best way to handle when an employee leaves the company? OneDrive and Email access
You can put the mailbox on hold, then delete the user - this provisions it as Inactive mailbox and will preserve all the data in it: https://learn.microsoft.com/en-us/office365/securitycompliance/create-and-manage-inactive-mailboxes
But they are a bit harder to work with if you need frequent access to the data. Some more considerations here: https://practical365.com/exchange-online/shared-mailboxes-vs-inactive-mailboxes-departed-users/
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.