Anytime we attempt something new or something repeated but at a higher level than before, it's a great thing. Trying allows us to explore new areas, physically, mentally, and emotionally. Trying something new can be a subtle way of preventing our world from getting smaller, and our thinking narrower. Trying something new can show us that we are more capable and less fragile than we had convinced ourselves.
Take for example, being in the gym and going for a new one-rep max. Sometimes we successfully make the lift and obtain a new max, boosting us to a level of strength we never knew we possessed and now begs the question; how much more could I have lifted?
There are times when we try though, and we fail. This can be a real bitch of a spot, if you overthink it, allow yourself to wallow, or if you do not learn from this attempt. There's that quote "You want to know the difference between the master and the beginner? The master has failed more times than the beginner has ever tried." A failed attempt is truly only a failure if we learn nothing from it. If we learn nothing, we are likely to repeat that failure again - setting ourselves on a path of self-sabotage and misery.
After an attempt and a fail or a miss, look at the effort and the attempt from as many different perspectives as possible. Note what you think worked leading up to it, and what you think did not work. Were you consistent leading up to the attempt? If not, there's a glaring hole that needs some attention.
If you attempted, but missed the lift - think about whether or not you were as consistent as possible* leading up to that attempt. Did you eliminate all possible variables that could have effected your effort in the hours, days, weeks and even months before that attempt? Were you consistent with your sleep, your food (fuel), your mentality, your drinking (hydration and alcohol), your practice, your programing, your warmups, your recovery, on and on... If you cannot honestly say that you were as consistent as possible*, then you can start tightening the screws right there, to be in a better place physically and mentally the next time you go for a new max.
* (As consistent as possible keeping in mind that kids, jobs, unknowns, tweaks, and setbacks can cause inconsistency but for the sake of this article, I'm saying "as consistent as possible" in reference to everything within your day-to-day control.)
We may go for a lift max and miss, indicating that we were not as physically ready as we mentally thought we were. Again, nothing to be upset or ashamed of, just time for some honest introspection. Work on identifying what may be the underlying cause(s) of the miss, so that we can correct them going forward.
We may do everything correctly and feel both physically and mentally ready for a new max lift, only to fail the lift. This can cause quite a tail spin, because somewhere along the way while feeling great, we convinced ourselves that we deserved to make this lift at a certain weight. This is what I love about weights, and about the barbell, it won't lie to you. No matter how badly you want to make a lift, if you haven't done the work to earn that lift, the barbell will exploit you. The barbell is analogous to playing against a professional athlete at the top of their game, every single day, every single rep. The barbell will not give you what you have not earned. That said, you cannot lie about the work that needs to go into your next attempt.
Do not get discouraged, this is how improvement is made. Even if you didn't obtain a new one-rep max lift, you should still walk away with an idea of what you can work on between now and your next attempt. This is learning, this is improvement; there's no failure unless we learn nothing from our attempts.