To use the block feature, go to an artist's page on the Spotify app and tap the three dots in the upper right corner. An options menu will appear with an option that says "Don't play this artist." Once selected, a pop up appears that states, "Ok, we won't play music from this artist." If you choose to block an artist, their music won't appear in your library, playlists, chart lists or radio stations. However, the artist may still come up if they are featured on another artist's track.
Spotify has previously played around with the possibility of blocking artists back in 2017 but decided against implementing the feature. The streaming service briefly changed its policies to remove controversial artists including R. Kelly and XXXTentacion from promoted playlists but backtracked on the decision the following push back from record labels and musicians. Spotify appears to now be putting the ability to make moral judgments on artists in the hands of users instead of tackling the task itself.