You need to setup some kind of server-side filters and have the “undesirable” messages stored in an IMAP folder in your mail server instead of on a local Mac.
We might be able to help if you can tell us what do you use for email. (iCloud, Gmail, Fastmail, local ISP, etc?)
You’ve probably heard about Sanebox¹ which I have been using since 2013 (wow, that’s a lot longer than I realized before I just checked). Sanebox is 100% worth checking out. It’s one of those services that I use every day and never think about (which is exactly what I like about it). It automatically filters my email so that my Inbox stays clean, and the lesser-important stuff gets filtered to a different folder that you can check when you want.
On the few occasions when it has stopped working (usually because I did something that accidentally kept Sanebox from accessing my email), all of sudden my email feels broken without Sanebox filtering it.
What I love about Sanebox is that it’s smart enough that I don’t have to do a lot of training for it, but if a message does get mis-filed, all I have to do is move the email message to the appropriate folder that the message should have gone to, and it will learn. Can’t get much easier than that.
Also, my favorite feature is something called the SaneBlackHole. Did you get a message from someone you never want to hear from again? Just put the email into the SaneBlackHole folder and you’ll never see another message from them again.
As far as I know, Sanebox works with just about any email system, so you might want to give it a try.¹
(Note: To be clear, Sanebox occasionally sponsors websites and podcasts, but they’ve never sponsored anything of mine. I’m just a happy, paying customer for the past ~7 years.)
¹ that link includes David’s referral code from when they recently sponsored his website. Use that link and a) you’ll get a discount and b) they’ll know that sponsoring David’s website was a good use of their ad money, so everyone wins.