Gaining confidence is catch 22; you’re not confident because good stuff doesn’t happen to you, and good stuff doesn’t happen to you because you’re not confident.
So here’s the key: Pretend to be confident, act confident even when you don’t feel it. Don’t be a scumbag but hold your head up high. Force yourself to talk to people even when you’d rather not. Pretty soon all that good stuff that those confident guys get – that’s coming your way. That will boost your esteem and make you more confident in yourself naturally; suddenly you don’t have to pretend anymore.