According to Carol Dweck, the ability to learn is not fixed. Rather, it can change with your effort, as intelligence or any other quality are traits that can be developed. Your basic qualities can be cultivated through a positive attitude and hard work. In this context, failure does not define you - it is merely a spark or a starting point that may enable you to grow.
An intriguing mental model for transitioning from a fixed mindset to a growth mindset is understanding that if you are currently unable to solve a problem, it’s because you’re not yet at that point on the learning curve.