I can’t wrap my head around this?

I made the stupid mistake of being friends with him after the break up. We were together about a year. When we were together, one day I noticed a new girl on his snapchat. He told me she was “a friend from school, i barely talk to her.” Later it came to light that she was an “old ex” and he began gaslighting me over the whole situation. When we broke up, we were still talking the same way we did when we were together. We told each other “I love you” and “I miss you.” Then he became distant. Eventually I got it out of him that he was seeing someone else, you can guess who. I learned that he was seeing her while texting me all those things. He even changed my name to a man’s name in his phone so she wouldn’t know I was around. He deleted our texts when she saw someone sent him hearts, he told her it was a group chat. I don’t know what makes me feel worse, the fact that he most likely cheated, lied to me, or lied to her too. It’s really messing me up. I feel horrible a month later. It’s eating me inside. I told him I was drained and tired of begging, feeling ignored, feeling like i was insane etc., and that was our last conversation, and with that i left his life. That hurts too. I miss my “best friend” sometimes.
I can’t wrap my head around this?
Post Opinion