Its going to be easier for you to "not care", if you have a fulfilling life outside of her. you have to spend most of your time on you and thinking about you. We know if the marriage was good it woulnd't have to be this way. The marriage is bad like the rest of us. If we stay "in it" we get hurt.
Once your doing your own thing it won't be any thinking about being detached, you will simply be on your own time. Over time, you will be able to be around her and not affected.