I am sorry to hear that. I have had a similar experience, after a very painful breakup I went through the same process.
The thing that caused it was the fact that I had no idea why it happened. So my days were spent asking "why? why? why?" - this was not very productive, the inner voice had no reasonable answer except "I did something wrong". Then it became "What did I do wrong?".
What worked for me was the ability to understand what happened. I had to ask some really direct questions and get some really direct answers (from my ex-partner and from my best friend, who is an ex-best friend today). As soon as I understood what happened, I knew it wasn't something that I had done wrong - so there was no reason to worry that I made a mistake (and that I could repeat it in the future).
I could sleep, I could eat, I didn't feel like the most evil wrongdoer on the planet and most importantly - I began thinking about building new relationships.
A few poems later, the case was resolved and I was involved in a new relationship and became a person again.
I guess it worked for me because I like to analyze things and understand the causes of every effect.. Without understanding, I find myself worrying about things that are outside of my control. I hope this helps.