Can't prevent it.
Reply spam can be **mitigated** client side with reporting & muting; global spam will always exist. It's easy to ignore from my npubs perspective.
For spam to effectively reach my attention today on nostr, it needs to be a zap with at least 100 or 1000+ sats.
(There are some ads I'd actually describe as "good" that came to me this way through nostr)