I'm sorry to hear that Sarah - seems you've just had a streak of bad luck, with your boy-friend losing interest and your best friend becoming distracted by another friend she's made.
I don't know your age, but sometimes, for who-knows-what reason, people, especially when young,(sorry, I am old, lol -3 teenagers)can be rather fickle in their friendships & relationships in general. I'd have to say, don't assume it has ANYTHING to do with you - the blame-game
is pretty pointless. You could just ask you friend out-right if there was any reason you haven't seen/spoken for awhile - or you could ask her if she'd like to meet for lunch or coffee since you two hadn't had a chance to talk lately..and maybe see if you can discern if there's any one particular reason why she's been out of the picture lately. As for the boyfriend, I can't really help you there, but I am very sorry - it's painful and a terrible punch to one's self-esteem, but the pain will lessen, and believe it or not, you probably won't remember this guy in a couple of years. Again, DON'T assume it's you or even mostly you...if you see some obvious mistakes you made, then just admit it to yourself. Most guys aren't big into discussing the reasons why they behaved a certain way. He may not even know himself why he's lost interest. Again, maturity plays a role in this - there are so many reasons why..without really knowing anything more, I can't really say.
Learning how to deal with sadness and loneliness, though, is just a part of what it means to be human...they are hard lessons, but there's no escaping them, and you will discover that you can come out stronger than you were before. (I know, easier said than done..but I've been there - school of hard knocks).
If there's anyone that you feel comfortable talking to (family member, pastor, etc) then it might be a good idea to see if you can run it past them and get their input.
Sometimes all we really need it someone to listen so we can talk it out and get some distance on something that is so terribly close to us.
Hope that anything I might have said helps and again, I'm sorry you're feeling so blue.
/hugs
Anne