When working at a problem, I usually describe the process of solving it as a decision tree.
I can try with library X or Y, I can choose this code structure or another. I can hook jenkins into gitea or gitea into jenkins… Every decision shapes the following.
I take a path mostly by intuition. I just do what seems right.
when working on something major (like a major framework migration), I tend to forget what decisions I made early on and what branches in my decision tree I cut off.
Working with colleagues helps to increase my awareness of the decision tree, but they are not always available, not that involved in the problem etc…
During one task I got seriously lost and wondered what I have been doing the last days. Out of interest I started journaling.
In the beginning I actually wrote to my journal every 30 minutes or so (pomodoro might have been a good fit here).
Nowadays it is mostly every couple hours and only when I have tasks where I think they benefit from it.
I found that I get a much better view of the decisions I had been making.
The migration I did back then actually changed quite a lot because of journaling iirc. I noticed that I made a decision quite early on, which (in hindsight) got in my way all the time.
I mostly recommend journaling to coworkers when they share the feeling that they are very unproductive. In many cases this is because thy did many things and forgot half of them. Just writing the journal fixed a part of that feeling for me…
I also get the feeling that it makes one better in estimating how much work something is…