Spam, aka junk email, is a nuisance, and it can be very annoying and time-consuming to deal with/delete it every day when you start using your email system.
All email sent to the Microsoft 365 (M365) users is processed by the M365 Exchange Online Protection (EOP) system. The M365 EOP uses many advanced filtering techniques to filter or block spam/junk email based on the content, header, language of the message, URLs referenced in the message, attachments, and other criteria.
To further fine-tune the protection, you can customize the Junk email settings for your M365 account by using the M365 Block or Allow settings to help control unwanted and spam/junk email messages sent to you. This is done by creating and managing lists of email addresses and domains that you trust and those that you don't. You can add the email address of the legitimate senders/domains to your "Safe Senders" list so that email from them will always go to your Inbox. On the other hand, you can add the malicious senders to your "Blocked Senders" list so that email from them will always go to your Junk Folder.
You can setup such customization using either Microsoft Outlook or M365 OWA (Web logon). Please see the respective steps below:
Add Addresses to "Safe Senders" List in M365
Add Addresses to "Blocked Senders" List in M365