Answer:
It's like when you make mistakes and you know you have done something wrong then you will either try to make it right or if you can't make it right you will teach yourself not to do it again because it might cost you something.
so when you make mistake, you learn some lessons from it as well.
NB: it doesn't mean make mistakes purposely.
some mistakes are just not reversible sometimes. They will make you end up regretting them for a life time.