Confidence stems from knowledge and experience. To build confidence, you must acknowledge the problems that keep you from building it. Think about what is causing these problems and solve them.
In certain cases, like social ones, it's truly is a matter of Just Do It. You don't have the confidence to speak to the person you're interested in precisely because you are not experienced in striking up random conversation. Do it, and in time, you'll learn what it is you're afraid of and how to overcome it.
For example, I was (and still am) always worried about ending a conversation. I hate it when they drag out too long, but I used to always feel ending one was awkward and abrupt. So I would end up avoiding that awkwardness and conversations would last forever... Now, knowing I want to avoid that and ultimately improve my conversing experience, I look for clues that signal a conversation could end soon. If the conversation is devolving into short one-word answers, that's usually a good place to let a small lull pass and end the conversation. I'll often break eye contact when I'm about done with a conversation in hopes that the lull will happen and I can end the conversation. More often than not, I've found the other person is just as happy as I am to have the conversation end and there's no awkwardness about it what-so-ever.
It seems a bit in-depth for something as trivial as conversation but it makes a world of a difference for someone with social anxiety.