You can choose to look at them as failure, as a sign you didn’t succeed in some activity or in reaching your goals, or you can choose to look at them as feedback.
In that way, you will use them to see how close you are to achieving your goals and what you need to improve along the way.
They will tell you on what you need to work more, what are your weaknesses and what you need to change to be better next time when you deal with the same situation.
Mistakes are temporary obstacles on your way to success, they are the way life tests you to see how determined you are.
If you quit- mistake is a winner.
If you stop and analyze your mistake you can learn why it happened and what can you do better next time.