All negative experiences have some benefits, even if they are hard to see or appreciate in the moment. By practicing finding these benefits with past failures, you may be able to enhance this ability so that it is easier next time you fail.
To find the benefits, start by picking a past failure and writing out three things you learned from it. For example, if you blew out a whole day eating the wrong foods, maybe you weren't prepared with the right foods or prepared at all. Ask yourself: Have you made any changes to prevent failures like this from happening in the future? If not, take the time now to make a few small changes.
It all comes down to how you look at them, just because you blew out a tyre doesn't mean you slash the other 3.