Control-click a message, choose Categorize Sender, then select a category.
All current and future messages from the sender will appear in the category you choose.
Tip: You can quickly view all emails in an inbox. At the top of the message list, click the category you are in or double-click another category to open All Mail.
Go to the Mail app Filter emails in Mail on Mac