Few things in life are certain other than death and taxes, but having to occasionally deal with people you’d rather, well, not, is definitely on that list. The good news, as this Wall Street Journal piece explains, is that science can help: new research found thought-tweaking exercises can literally teach you to be more compassionate and ultimately make it easier to handle difficult people.

Before diving into the research findings, it’s important to get a primer on how science defines compassion, writer Wall Street Journal writer Elizabeth Bernstein points out. She writes that previous research has broken down compassion into four parts: first, recognizing another person’s suffering, then being emotionally moved by it, wishing that person didn’t suffer, and finally, being motivated to do something about it.

To find out whether these skills could be taught, researchers at the University of California, Berkeley, Stanford University and the University of California, Davis designed a small study to analyze how well 51 adults fared after taking an eight-week course designed to teach them compassion. Their findings, published in the journal Mindfulness, suggest that everyone can use similar tools to learn how to better cope with difficult people.

Participants took Stanford’s Compassion Cultivation Training Program (called CCT for short) that includes learning meditation and doing thought-adjustment exercises. They also reported how anxious, alert, calm and fatigued they felt twice a day through an iPhone app, and shared whether they thought they could handle those emotions and if so, how. While the study didn’t directly look at dealing with difficult people, the researchers did find that over the course of the class, participants were able to “regulate and improve negative states, such as anxiety and stress,” and do the same for positive states, like calm, by “cultivating compassion, both for themselves and others,” Bernstein writes.

It’s not a huge stretch to imagine that being able to better regulate your emotions—especially ones like anxiety and stress—could better equip you to deal with everything more calmly and rationally, including folks who usually set you off.

The CCT course, which Bernstein notes anyone can take, was created in 2009 by Thupten Jinpa, the Dalai Lama’s chief English translator, in collaboration with a host of academic experts. The course gets increasingly difficult over the eight weeks and teaches compassion through thought exercises like “reflecting on how the difficult person in your life is someone’s son or daughter, mother or father, sister or brother—just as you are—and has hopes and dreams and sorrows of his or her own,” Bernstein writes.

It’s important to note that the program isn’t advocating you forgive and forget or become best friends with hurtful people. Instead, it’s a reminder that being compassionate is important for your own well-being: “There are consequences to ourselves in terms of negative emotions when we are walking around thinking bad thoughts about someone or trying to avoid him; this allows us to let them go,” lead study author Hooria Jazaieri, a researcher at Berkeley’s Greater Good Science Center and CCT teacher, told the Wall Street Journal.

The entire Wall Street Journal article is worth a read, but here are some key takeaways from the course that you can try at home.

  1. Ignoring difficult people won’t help. We recently wrote about how stifling negative emotions can lead to negative mental health outcomes, but acceptance of your feelings (even the ones you don’t really want to feel) can help. This applies to difficult people too, according to the Wall Street Journal piece. If you try to pretend the problematic person doesn’t exist, it might just make you hyper-focused on them. Instead, Bernstein writes, let yourself think about the person briefly and then let those thoughts drift right on by.

  2. Remember that everyone—including you—can be hard to deal with sometimes. As hard as it can be to accept that you too could be someone’s “difficult person,” we’ve all been that person. Jazaieri told WSJ that we’ve all said “things that aren’t true or have hurt people, and it’s humbling to remember that.”

  3. Breathe. When you’re feeling like you really can’t deal with the person in question, use this common mindfulness tool: take a second to scan your body and see how it’s feeling. Then take a deep breath.

  4. Actually put these skills into practice. Like any good skill, practice is important. Remind yourself, as Bernstein writes, that showing compassion for someone you don’t really like is going to be a challenge, and more importantly, it’s normal for it to feel difficult. Jazaieri underscores that you want to hone these skills when it’s not crisis-time, i.e. not when you’re standing in front of the person who really gets to you. “Think of yourself as an athlete,” Jazaieri told Bernstein. “You want to practice when it is not game time. So when it is game time and you are around this person, you can call upon these skills.”

So next time—and there will be a next time—you come face-to-face with someone who gets under your skin, just channel the CCT course: breathe, practice and remember that we’re all guilty of being difficult at one time or another.

Read more on the Wall Street Journal.