Friendship Over Relationship!

I got into a relationship with K. My friend M was just in a relationship with K. Me and K were dating and a lot of drama started. Me and M stopped being friends and sides started forming and people were calling me not nice things and saying I was a terrible person. Within a week I felt so down about myself I had negative thoughts. Me and M went to the counselor and worked things out and I broke up with K. K still tries to flirt with me and talk to me but i just say no thank you I’m busy. Next time no matter what your M is more important than your K.