The alternative is passive complicity, psychologists say. “When we hear this egregious, uncomfortable talk and we don’t speak up, what’s actually happening is that the person speaking is getting a green light,” said Sharyn J. Potter, co-director of the Prevention Innovations Research Center, at the University of New Hampshire. “It encourages them.”  It hardly takes a psychologist to explain the difficulty inherent in any such confrontation. “Simply saying, ‘I don’t appreciate that comment,’ or ‘That’s not cool’ — well, people aren’t going to like you very much after that,” said Linda Tropp, a professor of psychology at the University of Massachusetts, Amherst. “But they do get defensive, and change their behavior quickly.”  It is important to realize that you don’t have to make a dramatic, principled stand. “We don’t want bystanders to think they have to fly in with their Superman cape,” said Dr. Potter, who is also an associate professor of sociology.  There are many approaches people can use to stop talk they find noxious, say experts in what is known as bystander education. Among them: distraction, such as abruptly changing the subject. “Even in the locker room, guys can change the conversation, they can spray people with water, or crank up the music,” Dr. Potter said.  Rather than calling out the speaker and shaming him or her publicly, which can carry the risk of retaliation, you could make it about you. “You could say: ‘This is bothering me. One of my good friends was raped.’” Dr. Potter said. “If you put it on yourself, that might feel safer.”  Or you can try humor.  Gail Stern, an educator and a co-founder of Catharsis Productions, which gives sexual violence prevention training on college campuses and in the military, said that one deft approach might be to assume that the speaker is being outrageous on purpose, and to respond with something like this: “I love satire. It’s so weird that people believe that for real and it’s so cool you called that out.”  She calls that tactic “verbal aikido,” after the Japanese martial art whose practitioners defend themselves by redirecting an opponent’s attack.  An essential component of bystander intervention training is to get participants to imagine their own responses to scenarios. The goal is to get people to arm themselves with approaches that feel natural and innate, rather than outfitting them with model scripts. “If you have a plan in your head, then you can use it,” Dr. Potter said.  Psychologists who study the effects of such confrontation divide offensive behavior into two loose categories. One includes strangers acting out — a mother who slaps a toddler, a boy who punches his girlfriend — and bystanders, when they react, tend to do so viscerally and quickly. The other category includes offensive jokes or references among people who know one another, like friends or co-workers. In those cases, there are more gray areas, as well as personality factors to consider and often a relationship at stake. Objections, if they come, often take a little longer than bystander intervention does.  Deborah Cameron, a professor of language and communication at the University of Oxford, said that sexual banter often takes place among men who are friends, and that “the function of it is to promote bonding.”  Men may feel that if they challenge conversation they find tasteless, or simply don’t join in, “they’re spoiling the mood at a minimum and possibly putting their relationship to the group at risk,” she said. And sometimes they worry that “it will raise doubts about their masculinity or heterosexuality,” or that they will become targets of bullying, said Ms. Cameron, author of “The Myth of Mars and Venus: Do Men and Women Really Speak Different Languages?”  Yet subtle objections can stop people in midsentence, in some cases prompting later reflection, psychologists have found. In one type of experiment, for example, study participants guess the occupations of people based on a photograph and limited information, like “spends most of his days walking the streets” or “does regular housework.”  Most of these profiles are ethnically neutral. But some are ringers. The photo of a black man who “walks the streets” often prompts guesses of “homeless” rather than mail carrier; and a black woman who depends on money from the government gets identified as a welfare mom instead of a government employee or a student with loans.  Then the researchers, under the guise of fellow participants, push back. “We confront them in a variety of ways, sometimes harshly — ‘That’s racist!’ — and sometimes much less so, appealing to equality: ‘Shouldn’t everyone be treated the same?’” said Alexander Czopp, director of the Center for Cross-Cultural Research at Western Washington University. “Depending on how the confrontation is done, the participants might show different levels of defensiveness and anger right away; but they usually show less race-based attitudes on tests we do later.”  David Fleischer, director of the Los Angeles LGBT Center’s Leadership Lab, often sends gay and transgender people into socially conservative districts to do face-to-face canvassing. “We have to handle these situations all the time,” said Mr. Fleischer, now canvassing in Cleveland. “We are seeking out people who are prejudiced, and they’re using offensive language. And if you correct that language, just use different words yourself, and your tone and demeanor are kind, people are very responsive, and you don’t have to get into a screaming match.”  In a recent study, Mr. Fleischer and other researchers found that this kind of canvassing can soften the views of some 10 percent of voters — a large shift when it comes to political behavior, and one that has prompted wider training in such cordial, respectful “correcting” of language.  Of course, most people never get any training; they make judgments on the fly, about costs, tactics and personal integrity. And some are more likely to speak up than others, new research suggests.  Aneeta Rattan, an assistant professor of organizational behavior at the London Business School and Carol Dweck of Stanford found in a recent study that people who are optimistic and believe that others can change — that a bigot, with time, can change stripes — are more likely than the pessimists to say something.  “In that sense,” Dr. Rattan said, “this work suggests that your belief system about others can either be a barrier or a staircase where you can take that first step — even if it’s just saying, ‘I disagree.’”  A version of this article appears in print on October 13, 2016, on page A18 of the New York edition with the headline: Stopping Offensive Speech in Its Tracks. Order Reprints| Today's Paper|Subscribe
Many people are left speechless when a companion uses ethnic, sexist or racist slurs. But researchers say there are ways to cut such remarks short.