It takes time. The biggest thing I can stress right now is to not get sucked it. Trust me on this, it really can happen and then guess what, you are both a mess.
Time, time, time and focusing on yourself will help you detatch. Here is a way to look at it that maybe doesn't seem as wrong. When he finally needs you or asks for help or breaks down and they call you cuz you are the W, what good are you going to be to him if you are right there, stuck in his drama?
If you focus on the past, you ruin the future. You can only live for today.