You seem filled with a lot of anger, and that's ok.
Longer term, you may want to consider a more empathetic retrospectic view, so that you can have a more effective relationship with your kids and potentially your spouse, even though it can seem nearly impossible at this point. Some people are just bad people, but if you've had a relationship there is a chance it wasn't all bad and that there we some very good times.
I found The Divorce Recovery Workbook very helpful and cathartic. I tend to be more empathetic than most, but I definitely felt a lot of the same feelings of rage, feeling manipulated, and feeling taken advantage of (particularly similar about having kids). I had a lot of trouble processing that, and what I envisioned for future relationship post divorce. The workbook help out a bunch in processing a lot of the issues and trying to move away from unmanageable frustration/guilt/anger. I recommend it highly compared to most divorce focused books.
https://www.amazon.com/dp/1626250707/ref=cm_sw_em_r_mt_dp_MbqVFb0Q38ZG0
My opinion...
1) book a call with a divorce coach. It's a free one-hour slot (and they're pretty low pressure on continued coaching). It really helped me a lot and I think it'll be useful to you too. https://www.jbddivorcesupport.com/rapid-relief-call After you do the call, if you can't afford to continue... then start listening to free podcasts or join other divorce support groups (fb, meetup, etc.) that will provide you with group support. These are some immediate action steps that can help you have places to process your emotions. The r/BreakUps sub is also a really good place to help you learn from others and address the emotional aspect of it.
2) recognize that you won't be productive. It's just not going to happen. So you'll just try your best and that's okay. This is hard and you'll get through this.
3) for me... I knew I could spend the next year struggling to compartmentalize... or I could really just take some time to do intense processing of my emotions, that way I could be more able to "live my life" afterwards. If you have the time to do this, I would recommend it. I bought things like https://www.amazon.com/Divorce-Recovery-Workbook-Anger-Resentment/dp/1626250707 and https://www.amazon.com/gp/product/B00540PBQ4/ref=dbs_a_def_rwt_bibl_vppi_i0 to help me go through the process. It sounds like you haven't started the divorce process, so there may be other workbooks more suited for your current life stage. I did a lot of journaling, writing checklists of what I needed to do next (emotionally, physically, mentally) to keep moving forward, and lots of therapy (individual and larger group -- Journey Beyond Divorce FB community offers some free group therapy sessions).
TLDR - Answer: You don't unrealistically expect yourself to compartmentalize perfectly. You don't because it is a freaking dam that is bursting. So you let it go, you FEEL all the feelings. You find people and resources that help you do this as productively as possible. And it gets better. And you start being able to compartmentalize because you're dealing with a rapid river now, not a biblical flood.