I am mediocre at my job and I am fine with it. But lately, I am having this fear of losing my job because of my mediocrity and there are far more intelligent and skilled people than me. How do I deal with this anxiety?
First of all - there will always be someone better than you, unless you are a Fully Enlightened Buddha (Sammasambuddha). Our Buddha was also called the "peerless one" because he had no peers. Noone could match his qualities and attributes (except other Sammasambuddhas but there can only be one at a time).
So you can't really do anything about that aspect unless/until you become a Fully Enlightened Buddha if that's your goal.
Dealing with mediocrity, anxiety, fear etc. in Buddhism is dealt with in the same way as everything else, i.e. with mindfulness. The mind has to see phenomena clearly until it begins to let go of clinging to them. That letting go will lead to less attachment and more peace, happiness and wisdom.
In order to arrive at this Wisdom you will need Concentration and to get that you need to practice Sila (morality) which is the foundation of the Buddhist path. I advice taking Refuge in the Triple Gem and then take either the Five or the Eight Precepts.
For meditation instructions I advice to either find instructions in the tradition(s) you want to follow, check Youtube and better yet contact a meditation teacher/Buddhist monk and do an intensitive meditation retreat.
All the best.
The most mediocre is self. The way to change is self. So go forth the way that is best, else suffer the time
Edit: the compact person is superior. So be compact. Be without an external facade.
edit: it's only an influx (asava) of ego amigo. we are all mediocre. it's called manas (man). that is hard to avoid.
You might want to practice homelessness. That will at least give you some protection against an all out blitzkrieg.
Lord, I want—having shaved off my hair & beard and putting on the ochre robe—to go forth from the household life into homelessness. May I receive the going-forth in the Blessed One’s presence? May I receive acceptance?”
I guess if you were to say, I lost my job because I'm not smart enough, Buddha would likely accept you. Of course, you would have to deal with the rest of the order too. But at least you tried. That reminds me of Steve Jobs, who supposedly was trying to become a Buddhist monk at some point. But somehow he was told by some guru type he would be better off starting Apple.
Note, when I say practice homelessness, I don't mean you should go searching for alms. I mean cut down on consumption and the like.