Your children need to come first if you get a divorce. They are not pawns. They should never be used during any emotional power struggles between you and your ex.
This can happen overtly or subtly. In some cases, parents intentionally try to turn their kids against their exes, often by insulting them or even lying to the children. When two adults do not get along, they may both want the kids to take their side. This puts the children in a truly difficult position; they deserve a healthy relationship with both parents.
In other, more subtle cases, one parent may just try to become the favorite by being "more fun" than an ex. Instead of enforcing a bedtime, the parent may let the kids stay up late watching movies and playing video games. Instead of feeding them healthy meals, the parent may let them eat pizza and ice cream every day. Instead of buying them what they need, the parent may buy them gifts and toys.
Now, there is nothing wrong with giving children gifts or bending the rules occasionally, but doing it so much that it creates an unhealthy living situation for the children is a problem. Even after divorce, it is better for parents to work together to raise their kids, rather than using the kids to work against each other.
After you and your spouse split up, or during the divorce process, make sure you are well aware of your parental rights. The path to good parenting starts with figuring out a child custody arrangement that works for both of you.