I was going to tag you in this thread based on something you've mentioned some time ago about you and your ex still being very good friends.
Make no mistake. I have no reason to hate my wife, it's just things are absolutely not working and she seems to make some rather stupid decisions to which I have no input and I'd rather not want to be with her anymore in the form of a spouse, but rather as a friend.
Should have gone ahead and tagged, we're all here to offer our own experiences of it can help someone in some way.
As of my situation, she cheated and I caught her and loverboy kissing. Naturally I was pissed and sent her packing, at one point felt like shooting her until a friend handed me the gun and said I can go ahead and he has my back. The question that followed got ne thinking straight... "and then what after".
So immediately I had to start thinking about my daughter and my own life. Did not stay angry for too long and just made sure that I get my daughter and nothing else. We agreed that my daughter would stay with me and I was happy. Things went well between us and we never argued at all... until I started seeing someone years later. She made things difficult and was always trying to start a fight or make sure my plans were ruined if I asked her to have our daughter on a weekend which was not hers (previously wasn't an issue). She would badmouth my gf (now wife) to make things uncomfortable for her. I tried speaking to her and it became about another woman trying to be her daughter's mother.
We moved in together a year later and this pissed my ex off even more... despite the fact that my daughter had gained a person in her life who loved and treated her like her own.
Now keep in mind my daughter stays with me full time and goes to her mom every 2nd weekend. My wife was practically her mother teaching her all the things I would never have known.
Eventually my wife went and told her off. Not rude things, but explaining how she is selfishly spoiling her daughters upbringing with all the childish behaviour and fighting. She offered to step back and not do anything for our daughter and let my daughter figure things out on her own while she's home with me. I think that eventually got to my ex, finally she saw what silly behaviour she had and it stopped. Now years later we have an awesome relationship and she even contacts my wife for things regarding my daughter instead of asking me. They're also on good speaking terms and my wife has helped her with plenty other things not relating to our daughter. Its gotten to such a point that her daughter she has with loverboy was staying at our place for the first few months of lockdown as she didn't have anyone to look after the kid, and now that kid wants to practically live with us.
To summarize, things can get better in the end regardless of what difficulties comes your way. Something I personally live by is to always keep my side clean (or at least try). So I don't retaliate to remarks or try to get revenge by being spiteful (I have beat up loverboy after the initial cheating, but he deserved it). I have a firm belief that people see more than we think and clearly see where the trouble comes from in situations like these. Had I been the spiteful revenge type we would probably still be having fights going back and forth over the same silly things day in and day out and I could easily have looked like the cause of these fights.
As for advice, personally haven't lived with an ex in the same circumstances so cannot really comment. I cant see it being easy though. Would also be confusing for the kids who think that you guys are still together and then start feeling awkward when one of you starts seeing another person and that parent becomes the enemy.
I would probably try to get through the divorce while things are still good and hope the actual divorce process doesn't turn ugly (have heard from others that this is where things get really ugly). Also wish you luck through this time as it sure as hell can't be an easy time for you.