Losing confidence in yourself at work

Has anyone ever lost confidence in themselves and performance at work? I’ve all but lost mine, I work hard each day, come in way before my time and give my all even when I have no energy. But despite my best efforts I always get put down in some way and it’s always only me. So now I feel so hesitant in everything I do, like I can’t do anything right. I’m thinking of quitting. Any thoughts or similar experiences?