There are a couple of things that I do to shift my mindset when I am feeling a lack of confidence in a situation.
Shift my Perspective
First, I tell myself that "the best that I can do is the best that I can do. There may be many who are better, but the only thing that I can ask of myself in this situation is that I give the best that I can today".
Another mindset shift that really helps me to get out of my own head, and thinking about me... is to connect with other people and ask "what are they looking for here today? what are their struggles? what do they need from me today?" I often stand outside a classroom before I enter and ask myself this question about a couple of the participants waiting in the room... it really helps me forget about my worries and focus on others.
Act as a Mentor
Acting as a mentor to younger people helps me hugely. You are further down the path than someone. Turn back and give them a helping hand. Even if it is only a word of encouragement, it is a valuable contribution.
When I am thinking about me, I am anxious.
When I am thinking about others, I forget my anxiety.