Its a matter of choice, either you use it to be better or let it destroy you.
When we are in the heat of the moment, we only see the negatives of failure. Self doubt and anger kicks in. It is hard to admit that there's a lesson behind such unless we practiced seeing the good in everything on default. A human brain can see the negative first.
We can be better for sure in the long run with such failures. Most of our life lessons are from there too.