Many people lack confidence from time to time. The best way to get through it is to keep yourself occupied with activities/ hobbies you really enjoy. Don't worry so much about making friends/ boyfriends; it will happen on its own when the time is right.
Just force yourself to smile at people, make eye contact, and stay friendly. If you find it hard to start a conversation, then just be responsive to people who start talking to you.
If you have a friend you can trust who will understand yr problems, that will help. Otherwise, talk to your mom or a counselor or any older person you trust who will listen and keep it confidential. You need to talk to someone; it also helps to keep a journal. Also, try listening to subliminal CDs on confidence and reading books on this subject.
Daily affirmations work for some people, so that's also worth a try. But it takes time to build confidence& it's a long process, so be patient with yourself (I know as I've suffered from low confidence most of my life). Give it time& don't expect miracles overnight.
Whatever you do, DON'T compare yourself to your friends. We're all different for a reason. If a man you liked preferred yr girlfriend, it's disappointing- but it doesn't mean anything much really. It doesn't mean she's better or more attractive than you. It just means that people have different types they prefer and nobody can be everybody's type. She was this man's type- and you're somebody else's type.
When you start dating different people, you'll gain confidence- and you won't settle except for the right person. You're too young to settle down anyone, so you have plenty of time to find somebody who likes you and who you also like. It's just a matter of time.