not sure if you’ll find this useful but -
it is probably his own guilt that caused him to suddenly distance you, and/or he was trying to get into your pants and once he achieved that, he left and good riddance
it is not your fault, nor is there anything wrong with you nor was there anything you could’ve done to stop this, it had to happen
i think decentering men and male relationships for a while till you feel you are in a better mental space is really important
when u are vulnerable, thats when they try to leech onto u the most and they leave u more drained than they found u (forgive me for my harsh words)
you are much much younger than u realize, with time this thing that happened to u will fade, the memories will be replaced, u WILL move on. but be patient and take it day by day. at some point u will look back and you’ll already be over it
surround urself with friends, family, find something to focus on, u mentioned classes so i assume ur in uni, focus on passing your semester/year, dont sacrifice ur life for a man much less a man who took advantage of not only u but also that other girl, he doesn’t deserve u
im sorry that u had to go through this, its horrible and i can promise u this feeling will pass and u will get better *hugs*
If he really loved you like he said, he would've broken up with his girlfriend the minute you confessed. He wouldn't have put you through any guilt or immoral behaviour. That being said, it's good you recognize that what you did was wrong. You're only twenty so you're still very young and there are lots of things for you to experience down the road. This is just a random scene in your book, but make sure not to repeat the same mistake because you're not only hurting yourself here. There are other people being directly affected by your actions.
Just remember that if someone truly loves you, they would treasure you. You probably already know what that guy was after when he told you all those things, anyway, so there's no need for us to say it. Instead of constantly thinking about him, start working on yourself. Distraction is the best copium, after all. Find something that will become part of your daily routine. Work out (highly recommended), implement a good diet plan, go outside and hang out with friends, learn a new skill, etc. and just focus on it.
There are lots of things for you to do. Just remember not to come back to that guy if he ever tries to get with you again. He doesn't love you. Don't make him think you're easy and put that man in his place.

idk where else i could share this. i did questionable things and i feel karma just hit me in my face but its so hard to accept things. i am in love with a man who has a gf. he cheated on her with me, see i wont defend myself but as to why i did it with him is cuz i genuinely believed he also loved me and he would leave her. he said being with her was a mistake and he had always ever loved me. why did i believe him. i never knew his gf so i didnt even think how unfair it was to her. he always told me how toxic she was and how theyre just about to break up. anyways i knew him before he started dating the girl and got distanced due to friends group drama. i drunk called and confessed to him and he said he always loved me and i believed him and then got involved with him. my life was going downhill at that time and i overly relied on him. idk what happened he suddenly flipped one day, started treating me badly. he said he doesnt want to leave his gf and i was hurt but tried to be ok with him but he reached out to me again and i was too much in love. um i recently turned 20 and i was always a virgin. not that i never was in a relationship before, but i never went to that stage. idk why i couldnt say no, i was so desperate for him to choose me, so i lost my virginity to him. he ghosted me and i felt hopeless, got depressed and cried all day long. i stopped going to classes and everything. we got into a fight and he blocked me from everywhere. its been months and im still unable to move on. a part of me feels it was deserved, but it just hurts so much... so um how do i move on...i know i did shitty things but i hope i can get genuine advice