Divorce is s terrible thing. It is a shame that couples put their children through it. My advice to you would be to make the best of a bad situation. If you can change it, then do it; if it can't be changed, do the best you can under the circumstances.
Some couples divorce because they don't know each other well enough when they marry. Couples need to date for quite a while before they jump into marriage. Marriage is a very serious business.
I know that some men when they reach their forties think that life is passing them by and that they must have one last fling. For many of them who get caught, it is a breakup of a marriage that has lasted many years. Some women can continue to live with an unfaithful man, but most of us cannot. Once I have lost trust, it is over.
The best of advice I can give: Don't look back. Look ahead and think of the man you choose to share your life with. Know him a while before you marry. Your marriage will last much longer if you know each others good points...and bad habits. We can't all be perfect.