I went through a time when I had friends, but felt very lonely. In Jr. high my friends who I had known for years began doing stuff I was not really into. Drinking and partying more for instance. Many of them became cheerleaders and I was not really hanging out with them anymore. They were never mean to me, but I simply was not as friendly with them as I had been. What really helped me was a I got a job. People at work were so nice, and I was good at my job, so I felt good about my accomplishments, and had some spending money. Plus, the teenagers at work did not drink, so a lot of peer pressure was off of me. We went to the movies after work or grabbed something to eat. Funny enough at school, the other kids thought I was really cool, because I worked at a popular jeans place, and I didn’t really feel cool at all, I sort of felt on the outside among them.
My advice is actively put yourself out their to make friends. Invite people over, or to have lunch, or to a movie, etc.
How old are you? Not that it really matters, my advice would be the same for a 15 year old as a 50 years old, you can’t wait for people to come to you.