But you just have to keep faith in this learning process where you are both the teacher and the student to yourself.
I always fail too; in fact, I still do.
But I maintain the confidence in me... And I believe in myself.
Stop. Stop doubting your abilities because of some minor failures or a few mistakes. And stop thinking so highly of yourself: no one expect you to be perfect; no one can, because no one can be.