Groucho Marx said 'if you want to get a beautiful girl into bed tell her she's intelligent, and if you want to get an intelligent girl into bed tell her she's beautiful'.
Not strictly speaking relevant - but amusing.

And actually quite true in a lot of ways.
Confidence is based on a lot of things - how well you're doing with work/school, how other people respond to you and what they say, how comfortable you feel, how clever you feel, etc, etc. And yes, you might argue that some of those things are reactions to what other people feel about you but if you're getting negative reactions from people then it can chip away at someone's confidence.
There is no one fix suits all solution to 'lack of confidence'.