I am not a super confident person IRL but wanted to make a soldier character that doesn’t start confident, a bit childish and as he moves up the ranks he matures. I was wondering how to rp the fully confident part of him. For example, other characters being able to rush up to one another and demand information from them aswell as people being able to speak and not worry about the consequences or being able to reprimand people.
Ease into it slowly
Remember that role-playing should be fun, both for you and for the people you're playing with. The goal of role-playing is not to be "realistic"; the goal is to be fun.
You're facing two risks here. First, the stress of feeling obliged to project confidence might not be fun for you, since you're not used to doing that. Second, some of the things you've described (reprimanding people, rushing up to people and demanding information) might come across to your fellow players as not-fun when your character does it to their character.
It's great that you're creating a character who is confident, and it's great if while playing them you give yourself permission to do confident things if you want to do them.
But, if you feel like you wouldn't enjoy roleplaying your character do something in a confident way -- or, if you feel like you're about to roleplay something in a confident way and you're worried the other players won't enjoy it -- it's also okay to not force yourself, and just do what you're used to.
Use people as guides
You want to act confident? Think of a confident book or movie character you like and base your actions and role play off what they would do.
Use as many stereotypical confident person mannerisms as you want to bring across your point clearly. These often include hot headedness, flirtatious behaviour and showing off.
Instead of just saying what your character says, or saying “I do this”, say (characters name) says “blah blah” or (characters name) does this. This can help if you are a shy role player and I always use this.