Most people never want to address the idea of co-parenting, but the reality is that divorce happens, and parents have to adapt. Children are highly perceptive and capable of understanding divorce; even during infancy, children are able to sense tension, sadness and emotional distress in the home and between their caretakers.

The decision to successfully co-parent must be made before the divorce and separation. The best thing a couple can do for their children and themselves is to acknowledge that a relationship is not going to work out and begin looking forward. Divorce is painful, but the transition does not have to be detrimental to your children’s development.

Find an Outlet for Your Emotions

During separation and divorce, emotional support is crucial. You need a good mental head-space to process the various feelings, mourn the loss of the relationship and be a present, secure figure for your child.

Talk to friends, family members and, if possible, a professional therapist. Avoid “ranting” and instead seek productive ways to cope with your feelings that leave you feeling like you’ve made progress rather than just exacerbated them.

When you’re feeling sad, don’t shame yourself. Divorce is a part of life, and many times, it’s inevitable. It doesn’t mean you failed as a partner, spouse, parent or human being. Take comfort in your beautiful children, and know that this is the best choice for everyone. They deserve two happy parents, not one miserable couple.

During times of anger, remind yourself that children come first. Do not speak negatively about your ex-partner in front of or to them. They might not have been a good partner, but they can still be a good parent.

Communicate Professionally

You and your ex-partner may not even be able to stand the sight of one another, but you have to prioritize your children’s well-being. Setting aside your personal grievances, agree to conduct yourself professionally in one another’s presence.

Approach your co-parenting relationship like you would a business interaction. Do not discuss personal matters, use emotional appeals or attack one another. Just focus on the situation at hand: custody agreements, mutual decisions and parenting choices for the welfare of your children.

It may be difficult to not yell or get worked up, especially if your ex-partner isn’t communicative and is deliberately trying to start a fight. Make sure that you maintain your composure at all times, and do not feel bad if you need to leave the situation and reconvene at another time.

You may even find it helpful to meet one another at a marriage or relationship counselor’s office where you’ll both be free to speak in the presence of a neutral mediator.

Work Together to Create Consistency

Children thrive on routine and structure. You and your co-parenting partner may not share the same views on everything, but you must work together and establish a list of rules that children follow at all times. Otherwise, your children could get confused and stressed.

Don’t send mix signals. Flip-flopping rules between households only creates confusion and tension in a child’s life. Establish designated roles for discipline, homework, video games, bedtime and the like and work together to bring up your children well.

Don’t Get Hung up on Minor Details

If your ex lets your kids have an ice cream before dinner when you never would, don’t turn it into a huge argument. Learn to let small things go and focus on the important decisions that truly impact your child’s life and overall well-being.

The more you fixate on small details, the more likely you are to get caught up in a power struggle. Do everything you can to set boundaries and rules with your co-parent that you both will follow and then move forward with your children in mind.

Focus on what matters, and remember that at the end of the day, it’s all about your kids. You don’t have to allow your ex-partner back into your personal life—even as a friend, but you do need to find the best way to work with them as the other parent of your child. You will have to engage with them the rest of your life, so it’s better to give yourself the emotional space you need to heal and forgive now so you can strive toward a positive, productive relationship later. Get everything straightened out with a custody and divorce lawyer, set boundaries, and let your child know that you both love them.