First of all, don't get yourself in a knot about all this. Second, you already identified the problem, lack of confidence. Girls/Women can smell lack of confidence from across the room. But you can do something about this to fix the problem. Proceed as if you had all the confidence in the world and some to spare. Really do this, and with practice you will own it.
The other thing, many guys do which is stupid, they see this in movies and TV so they think you should walk up to someone you just saw and get a phone number. Or ask them out. This is nonsense, you aren't selling Herblife or Vinyl Siding. Instead talk about something you have passion about and invite her to join you in the activity which can be anything as simple as going to get ice cream, shopping, bowling, movies, computer games, music or your laundry together.