His advice for learning from mistakes is basically to look for the cues or patterns you missed that caused your mistake. That way you find the hints that would've helped you catch it in time.
I've been doing this myself, and writing up results in a weekly email (https://codewithoutrules.com/softwareclown/) and it really improves how much I learn from mistakes. As in, I go from "well that was stupid of me" to "ohhhhh, I should've noticed that."
Example: early in career I submitted code with bad variable names (foo, bar) to customer who requested I write a library. She pointed that out as bad practice, I was super embarrassed over my bad code. My takeaway in one of initial emails was obvious one of "write readable code."
But later I revisited using the cues/patterns approach, and realized deeper mistake was not listening to what she wanted—in this case, source code. If deliverable wasn't source code then variable names wouldn't have mattered and it would've been fine.
"How Learning Works" (I review it here: https://www.amazon.com/Peak-Secrets-New-Science-Expertise/dp...Gar Klein's books, in particular "The Power of Intuition" https://www.amazon.com/Power-Intuition-Feelings-Better-Decis...
Gar Klein's books, in particular "The Power of Intuition" https://www.amazon.com/Power-Intuition-Feelings-Better-Decis...
More generically: learn how to write. Most hard problems won't fit in your head. Most of the ways we think are too vague and fuzzy. Writing things down and working through something in writing can help find the limits of your thinking process, and help you find solutions. I review a book that explains this very well here: https://codewithoutrules.com/2016/06/15/writing-book/
(You could alternatively take a good academic writing class at your local university.)