They're hurting too
Divorce or separation is never easy and very often it can get ugly. Never mind the heartbreak of losing or leaving someone you've loved enough to envision your entire future with them; that's bad enough. Add to that a child, or possibly more than one and it's not just the two of you in the relationship suffering. It's a family.
Both of you trying to navigate and balance (or possibly aiming to destroy one another out of pure spite) your children are trying to do the same.
All of a sudden they can feel like it's not mommy and daddy anymore it's mommy OR daddy.
Whether you find a way to work together or not on custody and care, your children will still feel the need to choose. In some cases, one parent may try to win over a child by being more lax with rules, being the fun parent or by trying to out buy the other.
The harsh reality is even if you do your best to be there for your child, they may gravitate towards the other parent, whether it be because of actions like this, or just a stronger natural bond to that parent.
Whatever the reason, rejection like that from a child can hurt and make you feel hopeless. You may feel no matter what you do that you are in a never ending competition that you have no hope of winning. There will likely be times you feel like tapping out or throwing in the towel.
Sometimes kids forget that parents are people with feelings too, just like them. What's important to remember is that what's happening is not guaranteed to be permanent.
However your child might feel or their actions may make you feel, this too is an important part of your childs' life and development and they need your love and support just as much as you need theirs.