I found an article saying how to but I've never tried it so I can't say how well it works.
From the article
Blocking an artist on Apple Music is a relatively simple process. To do so, first open up your Apple Music library. Once there, click on the “For You” tab in the upper left-hand corner. From here, scroll down and select the “Preferences” option. In the Preferences window, find the “Artists You Don’t Want to Hear” section and type in the name of the artist you wish to block. Once you have done this, click “Save” and the artist will be blocked from your library.
Edit: I can't figure out how to make this work so maybe it's one of those fake help websites just so they can hit you with ads...
Exploring the pros and cons of blocking an artist on Apple Music, from improved listening experience to ethical considerations. Learn more about this feature and how it impacts you as a listener and the music industry.
Unfortunately, this does not work. Perhaps it has some hidden settings, maybe some configuration file.
It's weird that there's no simple way to block an unwanted artist.