Choose Mail > Settings, then click Accounts.
Select an account, then click Free up storage space for email accounts in Mail on Mac