I’ve recently been working on a project with a colleague whose style can really frustrate me. Two weeks ago, I was particularly annoyed during a meeting with this person and let’s just say, I shared my frustration. I left the meeting in somewhat of a huff, and as I walked down the hall, I thought, “Todd, could you have been a bigger victim?”

I would guess that most of us have experienced working with a colleague who irritates us on occasion. Our annoyance might stem from legitimate issues, like a coworker who constantly shoots down our ideas, or downright petty ones, like their habit of blasting podcasts all day.

But here’s the thing: it’s not about them. It’s about us.Our thought process. Our reactions. Our ability to choose our response.

So when you find yourself gritting your teeth around your least-favorite colleague, here’s how to turn the situation around:

Remember what you want to be known for. First, let’s back up. As you prepare for your week (for me, that’s Sunday night, but yours may be different depending on your work schedule), reflect on what you hope to accomplish that week. If you have a mission statement or some kind of document that articulates your core values, take it out and review it.

Connect with your values and your highest priorities. What matters most to you? What legacy do you want to leave—today, this month, at the end of your life? How do you need to treat people to get there?

Pinpoint your triggers. Next, jot down the names of people or situations that upset you at work. Hopefully your list isn’t too long. The key is not deciding your response in the moment—that never works, because our emotions will simply take over. We have to decide beforehand how we’re going to handle them.

Look at your list, and for each one, ask yourself: When this trigger happens,what can I do differently next time?What’s my internal response going to be?This doesn’t mean ignoring your irritations; it means not becoming reactive to them. It’s about choice.

Amazingly, sometimes just deciding you won’t let someone irritate you is enough. With the coworker I mentioned earlier, I realized I was allowing this person’s style to control me. I told myself, I’m not going to let this person’s style frustrate me anymore, and that simple phrase has made a huge difference. It reminds me that I control myself, not other people or even my own emotions.

Take a break.I work with an executive who is masterful at this. When a conversation starts to irritate him, he’ll say, “I’ll be right back.” Most people assume he’s stepping out to use the restroom or take a call, but he’s actually going out to re-center. I don’t know his exact thoughts, of course, but I bet he’s thinking something like: “This isn’t how I wanted things to go. But instead of getting angry, I’m going to think about the best way to influence this.” He’ll come back in the room with new energy and say, “Let’s get back on track. What were we thinking?” And it steers the conversation to a great place.

If you feel yourself becoming reactive despite your best efforts, try saying, “Can I have five minutes to think about this?” or “I’d like to gather my thoughts around this. I’ll get back to you later.” There’s nothing wrong with recognizing your limits. Give yourself the space you need to re-group.

If I’m making it sound like this is easy, forgive me. It is not easy. Choosing our reactions takes deliberate, daily focus. I still have to think about it all the time or I will slip up, like the meeting the other day. But time and again, I remind myself of who I want to be, and take back my power to choose my response based on what I value most.