Are you using the official lemmy webapp, or an app?
Pretty sure there was a browser extension that blocks posts containing keywords in the lemmy webapp IIRC but can’t remember what it’s called, if you do a search for a community called Lemmy Apps you should find one there
Aside from that, if you’re on mobile most of the apps support keyword blocking & filtering in their settings, such as Eternity, Connect, Mlem, Memmy and Sync