The steps that bring a couple to the brink of divorce are usually so painful that it’s hard to conceive the idea of a friendly, peaceful end to the marriage.

Guess what? It’s totally possible.

If you aren’t happy being married and your spouse isn’t happy being married, then you have all the common ground you need for a cooperative divorce. Here’s how to start:

1. Have compassion

Spend some time thinking about the breakup from your spouse’s point of view. It’s so easy to get caught up in your own emotional state that you can forget that your spouse is also struggling with various aspects of the divorce. That can make you unintentionally unkind and create unnecessary hurt feelings.

2. Find an avenue of communication

For many couples in the midst of a divorce, it’s easier to communicate in writing. That can help you put some necessary space between your emotions and your words (and give you a chance to think about what you’re saying before you hit “send” on that email).

3. Set your goals

Experts say that you need to think about your long-term goals, not the short-term ones. What do you ultimately want your post-marriage life to be like? If you keep that in mind when you’re making decisions today, you’re more likely to get what you want in the long run.

4. Plan on giving in

Almost nobody ends up with exactly what they want (or even expect) during a divorce. You can end up avoiding litigation if you’re willing to negotiate, give in a little and let your spouse have some of what he or she wants in return for some of what you want. A good divorce means that you both walk away reasonably satisfied — and in control of your futures.

If mediation fails, litigation is always a possibility — but many divorces can be mediated successfully if spouses keep these ideas in mind.