Here’s my paraphrase of a portion from Oliver Burkeman's The Antidote where he described two ways of looking at failure:

The way we look at failure is dependant on what we believe about our talent and ability.

If we see these as fixed or innate to who we are, we are more likely to see failure as a sign that we have fallen short of a challenge.

If we see our talent and ability as dynamic and incremental, we are more likely to see each failure as a sign that we have truly pushed ourselves in the face of a challenge.