You gain confidence naturally when we are good at something. When you practise something for a certain period, without realising it, you are confident in what you do.
Being a confident person is a different story. We think of those who know are confident as those who:
ask questions when they don't understand,
speak when they are disagree,
share when they have ideas, and
do when they think it's right.
The list above is a list of small skills that we can develop and become a confident person by just:
do it and pretend we are confident, or
break it down to baby steps and escalate the bar overtime.
Hesitation and fear grow when we haven't gained the skill we wanted to. Practicing is what required.
Confidence level differs from person to person. When someone looks confident in what they say doesn't mean they are good at it. It might just mean they are confident people. A confident person is just someone who gained a set of skills that makes them look confident, which is trainable.