The only advice I can give you on detaching is you have to believe there will be someone else who can make you happy and you need to get your life straight for that person. You can hope that person is your spouse but do not have expectations.
It takes awhile to tell yourself this, I am still struggling but as more days go by, I feel confident about myself.
Your kids are also your motivation, get a life for them too. Be the best dad ever because if your spouse is willing to walk away with kids so young, they may not be the best mom.