Hey, I had a similar thing happen with a friend of mine (although I didn't like her in that way, only as friends.) I mean the other girl coming in and ruining everything and being toxic and then my friend went off with a worse group of friends... It takes some time to get over it and move on, so allow yourself to be upset. It sucks, but it also means they weren't right for you and it's a lesson (I've personally learned a lot and I see that now). I used to think she was my best friend and we were platonic soulmates, but now I see "times change, people change", which is a quote I heard recently which sums it up I think. I have found that my best friend in the whole world (person B, we'll call her) was there the whole time, I just didn't realise it. She is my best friend and she's a far better friend than "A" ever was.
In terms of liking someone romantically, I've also felt that way about other people, and looked back later and wondered what I was thinking! We tend to romanticise people and create a perfect version of them in our heads (I feel we may do this with friends too but especially crushes). When we realise that they aren't this perfect person, things can change. You may have liked the idea of him, or liked that version of him, but there are other people at other points in your life you will be better for you.
Your romantic version of my Person B will come along.
And year 13 is pretty young to be finding a soulmate or life partner anyway - there's time.