Reduce the Size of an Outlook Data File (.pst) or Offline Outlook Data File (.ost)

If you delete items from an Outlook Data File (.pst) or Offline Outlook Data File (.ost), Outlook automatically compacts the file in the background during idle time, when you’re not using your computer, but Outlook is still running.

Note:Outlook only compacts the file if there is more than 20% of ‘white space’ (unused space) in the file.

You can also use the following steps to manually start the compact process immediately, which may take several minutes to complete.

  1. Delete any items that you do not want to keep and empty the Deleted Items folder.
  2. Click File >  Account Settings > Account Settings.
  3. On the Data Files tab, click the data file that you want to compact, and then click Settings.

    Note: If you are using an Exchange or Outlook.com email account, you need to additionally click the Advanced tab > Outlook Data File Settings.
  4. In the Outlook Data File dialog, click Compact Now and then click OK.

Ref: https://support.microsoft.com/en-us/office/reduce-the-size-of-your-mailbox-and-outlook-data-files-pst-and-ost-e4c6a4f1-d39c-47dc-a4fa-abe96dc8c7ef#ID0EAABAAA=Newer_versions