It has been said that you only really fail if you don’t learn from the experience, this is true in most cases, escpacially those that makes you ask this question.
So to answer your question, you learn snd show others that you have learned.
Say you are working a papermill and you make a misstake causing and entire batch of product worth €5000000 to be ruined, a bad manager would just fire you, a good manager would understand that he just spent €5000000 training you not to do that, and that training would stick, and keep you.
It has been said that you only really fail if you don’t learn from the experience, this is true in most cases, escpacially those that makes you ask this question.
So to answer your question, you learn snd show others that you have learned.
Say you are working a papermill and you make a misstake causing and entire batch of product worth €5000000 to be ruined, a bad manager would just fire you, a good manager would understand that he just spent €5000000 training you not to do that, and that training would stick, and keep you.