How to block spam traffic?

Hello friends,

I want to know How to block spam traffic?