This is the way I view the path to constant improvement:
Be as hard on yourself as you can without spiraling into shame and self loathing.
When you start feeling like a failure you’re being too hard, and you need some self-compassion. Before you hit that point though, view your actions and decisions critically, dissect them, analyze them, find the flaws and imperfections. And then, as you say, make peace with them. They do not define you.