Some of us learn from other people's mistakes and the rest of us have to be the other people.
Mistakes are a part of life. In fact, they're part of any learning process. Don't feel discouraged, instead, learn from them and gain wisdom from your experiences: https://www.ziglar.com/product/ziggets-personal-development/