Feeling like a failure has little correlation with actually failing.
There are people who have failed more times than you and I can count, who are happily continuing in their work.
There are others who have achieved more than most of us can imagine, who go to work each day feeling inadequate, behind, and yes, like failures and frauds.
These are not cases of extraordinary outliers. In fact, external data is almost useless in figuring out whether or not someone is going to adopt the narrative of being a failure.
Failure (as seen from the outside) is an event. It's a moment when the spec isn't met, when a project isn't completed as planned.
Feelings, on the other hand, are often persistent, and they are based on stories. Stories we tell ourselves as much as stories the world tells us.
As a result, if you want to have a feeling, you'll have it. If you want to seek a thread to ravel, you will, you'll pull at it and focus on it until, in fact, you're proven right, you are a failure.
Here's the essential first step: Stop engaging with the false theory that the best way to stop feeling like a failure is to succeed.
Thinking of one's self as a failure is not the same as failing. And thus, succeeding (on this particular task) is not the antidote. In fact, if you act on this misconception, you are setting yourself up for a lifetime of new evidence that you are, in fact, correct in your feelings, because you will ignore the wins and remind yourself daily of the losses.
Instead, begin with the idea that the best way to deal with a feeling is to realize that it's yours.