Just noticed a habitual response.
I was getting stuck with a coding problem. I was not applying much method to my attempts at solving the problem. Relying on what I already know (limited) or worse still what I think I know (fuzzy). Hit and hope. Cyclical failed attempts. Allowing my failure to get the final solution to overshadow progress I was making towards it. I don't like the feeling and thoughts that come with being stuck.
I apply a workaround. I look for a distraction. To avoid feeling and thinking like this. Not a solution or means to find a solution but a distraction. Writing. Eating and drinking. Exercise. Housework. Company. Those are just the good ones.
I get no further with solving the problem. I am wilfully distracted and not making progress. It does not feel great.
Substitute coding problem with some other challenge. Given lack of progress over time and and the same behaviour follows. Find a distraction to avoid the feeling of being stuck, procrastinate and eventually avoid. Conciously the work; subconciously the feelings that come with being stuck. Feeling inadequate. Not good enough.
The risk now is to give up. Perhaps rationlise why it made sense to give up (lost interest, bored, something else came along...) to feel a better about doing so. Self belief and efficacy erodes.
A different response to getting stuck then. Notice what's being tried. Notice what's working and what's not. Break the process down into steps. Take some notes. Improve debugging skills. That might help. Revisit the key topics involved. Stick with it. Pomorodo time and keep coming back. It can help to chunk up focus time and breaks.
If though still choosing to be distracted then at least notice that and from time to time choose one that will do no harm and perhaps even some good! Like journaling perhaps?