There’s a right way to disagree with your boss.

Take President Donald Trump, who retweeted a Fox News story on Tuesday. The situation got awkward when, hours later, United Nations ambassador Nikki Haley complained about the same article her boss had tweeted.

Considering that 82% of people don’t trust their boss, Ambassador Haley is not the first person in her position. And according to Gallup, only 18% of managers have a “high degree of marketing talent,” so those people aren’t necessarily out of line.

In May, CBS Evening News Anchor Scott Pelley was reportedly forced out over disagreements with CBS’ chairman over his contract and salary. And software engineer James Damore was canned by Google last week after complaining in a memo about the diversity training he was required to receive by his supervisors.

And according to Business Insider, complaining about your boss on social media, refusing to follow directions, gossipping about your boss are all among the behaviors most likely to get you fired.

If you disagree with your boss, whether or not to confront them comes down to your relationship, says Laura MacLeod, founder and CEO of From the Inside Out Project.

“If you are respected and there is trust, disagreement should not be a problem if handled judiciously,” she said. “But if you’re on shaky ground or your boss is a tyrant…don’t bother.”

And be sure to pick your battles–not all disagreements are worth ruffling your boss’s feathers. “A big project decision or policy that might hinder your work or team progress, definitely worth it,” MacLeod said. “Where you can go to lunch or if Casual Friday will be cancelled, maybe not.”

If you decide to confront your boss about your disagreement, make sure to follow these rules:

Do it in private. Your boss is much less likely to listen and compromise in front of their colleagues or superiors. “They may push back hard just to show they’re in control,” said Nicole Wood, co-founder and CEO of Ama la Vida Coaching. “It’s best to discuss it one-on-one.”

Know where they’re coming from. Thinking through why your boss arrived at their decision or mind frame will help you arrive at a consensus. “If you understand someone’s thought process, you can better help them reframe and understand your own,” says Foram Sheth, co-founder and coach at Ama la Vida. Your boss is also more likely to try to understand your viewpoint if it’s clear you took the time to understand theirs. There’s certainly a reason your boss does what they do–give them credit where credit’s due.

Compliment them. Everyone loves a compliment, and your boss is probably no exception. “I can see why you think X is the way to go. It’s a sound, proven strategy. But I’m wondering if we might try Z,” is the line MacLeod suggests. They’re more likely to support you if you’re building off their idea, rather than contradicting it.

Present an outcomes-based case. “You and your manager are on the same team,” says Tim Toterhi, founder and executive coach of Plotline Leadership. “Offer a suggestion that will help you both win.” Show your boss why your idea can benefit the company. Wood suggests presenting hard numbers if you can: “Show that your perspective is rooted in data and not driven by emotion.”

Know when to back down. “Your boss may disagree,” warns Wood, “and you should be prepared to receive that feedback with humility, and step down if the conversation is no longer progressing.”