What helps me is to stay calm, not use a mad voice or anything, and to say I simply disagree with viewing entire groups op people as less. If people disagree with that, then that's their problem. It's not up to me to prove the validity of other humans, it's up to them to fix their bigoted opinion. Let them get mad, let them mock you, but do not lower yourself to that level. Don't let them drag you down. You will probably inspire others who are afraid as well to speak up.
It's frustrating, I know. But yelling at everyone who is a racist or a bigot does not help most of the time. You will probably get into a heated argument and that mostly benefits the racist.