At some point in your career, you’ll undoubtedly cross paths with colleagues that irk you. Maybe it’s the presumption that their opinions are the only correct ones on the planet or their blatant brown-nosing to get on the boss’ good side. Perhaps you can’t stand how their arrogance, moodiness or quick temper puts a damper on the company culture.

Difficult co-workers can high-jack your emotions. They trigger something in you that causes you to almost act or think irrationally , which is not exactly a healthy situation in which you can succeed. You may find that sooner or later your exasperation expands until every little thing that person does makes you want to tear your hair out.

Unfortunately, in the case of annoying co-workers, you can’t simply remove them from your life. Avoiding them around the office or circumventing one-on-one meetings probably won’t work either.

Fortunately, there’s a way to put a positive spin on the situation that stems from a counter-intuitive insight about dealing with difficult people. When we discern a quality in someone else that irks us, we can benefit from pausing to examine exactly why we have that reaction and look more closely at what it can teach us about ourselves.

The friction of interacting with an annoying co-worker actually presents a chance to cultivate essential leadership skills like assertiveness, self-awareness and confidence. It can provide an unexpected opportunity for personal growth that goes far beyond solely testing the limits of your patience.

Try this three-step approach to dealing with difficult people at the office:

1. Identify the person that irks you.

Amidst a daily pattern of low-grade irritation at a co-worker’s annoying habits and idiosyncrasies, you may not notice exactly how much he or she aggravates you on a deeper, personal level. Think about the co-worker you vent about most often to your friends or family, the one you have interactions with that derail your day or the co-worker you would never want to be stuck in a crowded elevator with. Take the time to specifically I.D. him or her internally.

2. Figure out exactly why this person provokes such resentment.

Start by getting specific about your feelings towards this person. Rather than making overblown, blanket statements like “She’s the most annoying person on earth,” identify the emotions provoked. Irritation? Insignificance? Disappointment? This list can help you find the right words to describe your feelings. Simply labeling the emotions has a soothing cognitive effect that allows you to embrace a solution-focused mindset. Similarly, identify the exact behaviors your co-worker does that frustrate you. Move from “I can’t stand being around him” to “I think it’s really disrespectful when she talks over people in meetings.”

3. Learn to see your reaction to that person as a form of feedback.

Use the other person as a mirror. Question what your reaction to that person can teach you about yourself. For instance, consider what this person is modeling for you in a “how not to be” way. Does juxtaposing your co-worker’s chronic forgetfulness with your penchant for organization and systems show you that these are strengths you want to leverage more, spurring a career pivot? It’s also possible a co-worker’s behavior may trigger fears or insecurities you want to work on. If a colleague annoys you because he’s always stealing the spotlight, consider if it’s touching a concern you have about coming off as cocky if you did the same. Now flip the script: Instead of simmering in upset, question if learning to do a better job of trumpeting your own achievements is something you want to work on. Then make it a priority to do so.

This strategy of “looking in the mirror,” as it’s referred to in leadership development, may seem simple but it’s not always easy. In fact, it may bring to light ways in which you’re no longer willing to be mistreated (such as being yelled at or criticized), revealing how you may need to create stronger personal boundaries in relationships, including those with co-workers or your boss. For others, it may touch on vulnerabilities like feeling like a fraud in your job or approval-seeking at the office.

These tricky emotions take bravery and courage to face. Most people spend a lot of time ignoring these challenges, missing out on the ways “looking in the mirror” can pave the path to lasting personal growth.