Between the networking, the interviewing, the negotiating, and the onboarding, moving on or up can feel like a job of its own.

Odds are you’ve had to work with a difficult or even detestable person. That boss who takes pleasure in calling you on a Sunday to push a deadline up on a major project. The co-worker who never gives you quite enough information to succeed in a team assignment. The continually dissatisfied client who proclaims his disappointment, always at top volume.

“Believe me,” says Robert I. Sutton, “they’re everywhere.”

Sutton, a professor of organizational behavior, by courtesy, at Stanford Graduate School of Business, has become an expert in dealing with jerks. His 2007 book The No Asshole Rule: Building a Civilized Workplace and Surviving One That Isn’t was a New York Times bestseller and won a Quill Award for best business book. His latest book, The Asshole Survival Guide: How to Deal with People Who Treat You Like Dirt, is available now.

Here Sutton discusses ways you can work with the brutes without losing your mind.

Workplace Jerks: No Jerks Allowed

Is the workplace just filled with awful people?

The Workplace Bullying Institute conducts research asking, “Have you ever seen, observed, or been subjected to prolonged bullying or repeated bullying?” Replies vary slightly from year to year, but essentially 50% of Americans say “Yes.” And then, when asked, “Have you ever been the perpetrator?”—less than one-half of 1% answer yes. Obviously, something is wrong.

So is it us or them? We human beings are not able to see our own weaknesses. The best we can hope for is to have people in our lives who will tell us the truth. I talk about the power of having the right spouse or life partner to tell you the truth. But it can be a mentor, or a friend. Just be quick to label yourself as part of the problem and slow to label others.

Let’s assume that we are not the jerk. Is there an acceptable level of nastiness? And if there is, how do we assess it?

There’s no scientific gauge above which somebody goes from tolerable to intolerably damaging. A lot of the signs have to do with how you are affected personally. How much are you suffering? How’s your physical health? How’s your mental health? Are you becoming toxic yourself? It is very contagious. The other thing that I would ask is how much abuse are you willing to take to get what you want.

What are the signs of a certified jerk?

If there’s a trail of people who feel demeaned, de-energized, and hurt wherever that person goes, that’s usually an indication.

How do you handle a slime who’s a client?

It gets really tough when you’ve got somebody who is really, really lucrative, but treats people like dirt. That’s where at least you want to try to have a conversation with him or her. But that’s part of what a senior partner’s job is—to cool that individual down, to caution them to treat people with more respect.

But honestly, if getting rid of the client means that people don’t eat and your firm goes out of business, it’s a lot tougher than if it’s a small client or a customer with whom you’re having just one interaction.

When I have private conversations with people in the professional services industry, they always talk about an “asshole tax”: The nastier you are, the more money you end up paying and the worse people you have serving you.

What should you do if the jerk is your boss?

First, can you get out or can you move? It’s really hard for me to find people who quit a bad boss who treated them like dirt and were sorry about it. But a lot of times, moving from one organization to another is not as smart as moving to a different part of the organization you’re in. When you stay in your own organization, you often have more information about where you’re going than if you go to an outside organization. The company that does this most consistently and effectively is Salesforce.com. Every three or four months in engineering, Salesforce has a job fair where people recruit one another and talk about switching teams. The goal is to make it as easy to switch within the company as it is to leave the company.

But the key thing here is don’t be stupid about it. It’s so easy to be impulsive and say, “Take this job and shove it,” but if you burn bridges, all sorts of bad things happen.

What if you can’t leave or transfer?

If you can’t escape the situation, treat the jerk as a toxic substance that you avoid as much as possible. Research shows if you’re more than about 100 feet away from somebody, they might as well be in another country. If you’re within 25 feet of a toxic person, the chances that you’re going to become toxic go up—and the chances that you’re going to get fired go up as well.

We human beings are not able to see our own weaknesses. Just be quick to label yourself as part of the problem and slow to label others. – Robert I. Sutton

Also, meet with toxic people as rarely as possible. Try to find ways to reduce the frequency and intensity. One example from the book is a doctoral student who would get all these nasty emails from her advisor. Instead of answering everything right away, she’d wait a couple weeks and send a single measured email in response to the whole batch. Find ways to slow the rhythm.

What if you have to sit near the sleaze?

There are mind tricks to protect your soul—ways for the situation to be less upsetting to you even though you can’t change it. My favorite is a guy at Stanford who pretends that he’s a doctor who studies “a-hole-ism.” When he sees these people in meetings, he pretends that it’s a privilege to be able to see such a rare specimen. It’s a sort of detachment—pretending you’re a doctor, just observing.

What’s the tactic of last resort?

The last one is fighting back. You should do this only with proper precautions and with a lot of thought. Your chance of winning go up when you understand the power structure and dynamics, document the bullying, and gain allies.

What if the cad is just clueless, not mean?

Pulling them aside and having a conversation with them can be quite powerful.

How do you avoid jerks from the start?

What’s the best way to hire an employee? Give the individual a job sample test. Or in the modern gig economy, do a project or two with the prospect and see if it’s going to work.

And when interviewing for a job, watch for how a potential boss treats you and other people. There was a manufacturing manager candidate who, during his interview and company tour, noticed as they walked through the floor that everybody was avoiding the boss. They were silent and acted afraid of him. And then, during the interview, the potential boss wouldn’t listen and kept interrupting. So that’s a reasonable diagnostic sign. Also, talk to people who work there, especially for the immediate boss and work group that you’re going to go into.

What creates jerks?

On average, the more well-educated and the wealthier and more prestigious people are, the worse they are.

This post originally appeared on Insights by Stanford Business.