I just break things enough times until I internalize the knowledge into my soul.
Kidding aside, I do wish I was more disciplined about documentation.
It could have really helped me earlier in the week in fact. I figured out something really clever a couple of months ago, promptly wiped the computer. And now I can't recreate it. I've come up with a halfway solution, but it's not as elegant as it used to be.
To be honest with you, this is a really good use case for a large language model - self hosted or other wise. You know Karpathy's LLM-wiki method?