I’m very sorry you are so lonely. It might help, if only a little, to know that you aren’t at all alone in your struggles to find friends. It’s part of the challenge of the teen years and it can be very painful while going through it.
I don’t know if medication will help. If your anxiety is overwhelming, medicine might bring it down enough for you to feel a bit braver. But, ultimately, you will need to learn to handle your anxiety and how to do your part in finding and maintaining friends. If you need support for that, a counselor would be helpful.
You said you have a few friends. That’s great. I bet you don’t know that the average number of real friends (even for adults) is 3! Most people have acquaintances as well. But all a person really needs is 1 to 3 close, close friends.
It really is your choice whether or not you see your friends more often. Don’t wait around for people to ask you to do things. Get active. Start inviting people to do fun things with you so you have more contact. It’s doing things regularly with people that changes them from being acquaintances to friends. Chances are that doing more will help you meet more people who are potential friends.
It would also be helpful for you to join somethng — even though you probably don’t feel like a joiner. People who share experiences on a team, in a show, or doing volunteer work often become friends. Casual contact through doing a mutual task helps people get to know each other without as much pressure as a social event.
I wish you well.