If you identify a Junk message in Mail, then click on the Junk icon in the Mail toolbar your Mail application will learn that that message and subsequent messages from that sender is junk. If 'Junk' is not in the tool bar right-click on the toolbar and select Customise Toolbar to add it.
If you also have ticked the box called Enable Junk Mail Filtering found at Mail > Preferences > Junk Mail these emails will be filtered according to your selections in the subsequent options, such as 'Move it to the Junk Mailbox'. In this example the identified messages will be filtered into your Junk folder before it gets to your In box.
Examine the other options in that panel. Apple outlines here these options.
Still in Mail Preferences, over in the Accounts tab you will see in iCloud > Mailbox Behaviours options for the Junk Mailbox. Select to erase after one day - or longer if you wish.
Junk emailers can be persistent and seek to evade these traps for their activities so despite your best efforts in employing these options you may find similar emails appearing in the In box.