This guide is geared specifically to creating an inbox rule to help clean up Undelivered emails after an email account has been compromised.
Once you log in, click on the Settings (gear icon in the upper right hand corner of the screen), then select View All Outlook Settings at the bottom:
Click Rules → Add new rule
This rule only works on new emails coming in. You will have to either manually delete the emails currently in your mailbox or use the Outlook desktop application to run the rule on your mailbox.
To manually run a rule in the Outlook desktop application please see this Microsoft KB article: https://support.office.com/en-us/article/Manage-email-messages-by-using-rules-c24f5dea-9465-4df4-ad17-a50704d66c59