We are still working on it. Even though neither of us was married before, we knew going into this marriage that the odds of staying married were against us. Just the fact that we each already had a child and were of different religions put us in the less than 50% category. Add in some other issues that he deliberately hid from me (that he had been dx'd with a mood disorder and had some other characteristics that are unchangeable but affect relationships), which I found out a few years into the marriage, and it's a minor miracle that we're together at all. But with kids involved, we talked through known "deal breakers" well in advance of getting engaged - things like that I make more money than him and will always work, or that I wouldn't marry someone who wasn't OK with us raising the children in my religion, or that we would have at least one child together, and once we picked a town to raise our kids in, we're not moving. Really, we were thoughtful and careful and on the same page about everything except the secrets he kept from me. I really thought I knew everything I needed to know and was choosing a life partner who I loved and who would be a good dad for my son. We committed that no matter what, we would not put our kids through divorce (the older ones had already had upheaval in their lives since birth) and that even if things got bad, we would stick it out for 20 years. We jokingly call it the "20 to life" plan.
This plan was tested many times in the first few years of our marriage - I got pregnant accidentally a few months before our wedding and his reaction was so unexpected that we almost didn't get married. He was also pretty awful and selfish through our S. pregnancy, and then we dealt with the aftermath of his affair and other secrets. It was terrible - we had 4 small kids, temporarily carried two mortgages and were so broke and logistically challenged that we had no way to even temporarily separate to sort things out. Through it all, what kept us going was his willingness to go to counseling, take responsibility for his actions and try to change. We've been through a lot of counselors, a lot of medication, a lot of prayer, a lot of pain, a police report/arrest/court, a short separation and a lot of good times to balance the bad over the years. We've been married almost 9 years. We push forward hoping and praying that we're doing the right thing for our kids, working with professionals who assure us that they are OK with us together, that we are a family who is better together than apart. I hope that 10 or 20 years from now, the kids look back and agree.
At the end of the day, I definitely don't judge anyone who is divorced. I never married my son's dad and my husband didn't marry his daughter's mom because they are both toxic, dysfunctional people who would be terrible partners and parents. Not everyone figures this out before marriage, and people certainly change. Both spouses have to work on fixing a marriage, and some families are definitely better apart than together. For my husband and I, we're just not there yet (and hope to never be).