For me, having a clear purpose in my life has been essential. But it was something I had to think long and hard about before I understood it. and ultimately figured out the purpose of my life.
Encourage yourself.
Instead of focusing on the negative, replace your criticism with encouragement. Give constructive suggestions instead of being critical. (“Maybe if I try to do ____ next time, it would be even better,” instead of “I didn’t do that right.”) Compliment yourself and those around you on what you’ve achieved. (“Well, we may not have done it all, but we did a pretty great job with what we did.”) Giving praise will also encourage others to praise you, and this builds up your confidence to continue on the path.