It’s two in the morning, and your neighbor’s dog is barking. Again. While it might be tempting to head over there and given them a piece of your mind, for your own peace of mind, handling neighborly conflict is a tricky business that can easily spiral out of control to involve more than you and the guys next door. Here are three ways to keep your cool in heated situations.

Use Your Wise Words

Planning ahead, when you have the time and ability to, is not a bad thing. Write out what you want to say and talk about it with a partner or close friend. Are you coming across as judgmental or accusatory? Even if this neighbor is the worst one you’ve ever had since that one guy in college who wouldn’t stop playing the trombone, coming from a place of harsh, accusatory language will put your neighbor on the defensive. If you’re not ready to do this in person, that’s fine too. Write a note, send an email or text, anything that gives you a little time to think carefully about what you’re going to say.

Come in for Compromise

So maybe your neighbor’s dog has anxiety, or they have back problems that keep them from taking care of their yard. Remind yourself that your neighbor might actually be a good person having a serious of really bad days, and you’ll have an easier time coming at this from a place of compromise. Sometimes, it helps to have an idea of how much ground you’re willing to give in mind before you actually go in to discuss this. Unless your neighbor is deliberately being a jerk or actually doing something illegal, trying to work together towards a solution can be much more productive than simply demanding a change or even taking legal action and having to contact a property settlement lawyer or other professional.

Make Room for Mediation

Once you’ve discussed the issue with your neighbor, the ball is in their court to implement a solution. If they refuse all possible solutions, though, or double down on their poor behavior, it might be time to call in a third party for further assistance. When you’re looking for a mediator, try to find a neutral third party instead of going directly to a friend. Your landlord might be a good option for this, or you can ask around about a housing association mediation board.

Before you dive headfirst into any kind of conflict, it’s important to think about why you’re doing what you’re doing. Remember, you’re not here to punish your neighbor for acting up, you’re here to try and make life better, for the both of you, and everyone else around you. Good luck.