Confidence has nothing to do with being popular or liked. Popular people tend to be more outgoing, but can be just as insecure as anyone else. And you like who you like - it's chemistry. If anything, it's the other way around. When you're with people who like you, your confidence goes up. Also, your confidence goes up when you accomplish something that means something to you personally. A lot of people do this through sports or physical fitness. I wrote a book, which helped me a lot. (No sale yet, though.)
I think the secret is to follow your values, and you're more likely to connect with people you get along well with. I'm still working on that one, though, so don't take my word for it. Autistic people may need to do more than just follow our values.