Are we talking about in person or on a forum?
In either case, STFU is ineffective.
Usually I find people who are wrong have drawn conclusions from wrong or incomplete information. Finding out what that information is usually helps determine what, if anything, can help them.
If it is an emotional thing - I'm usually not willing to try to work with the person. And it depends on how old they are. At some point, if they are so fossilized in their views (usually these people no longer work and thus are limited in their influence over other people) then even if they are close to me I just state I completely disagree with them and, if it is really bad enough, leave.
Forums are a bit different. Can't leave due to a racist or three.