I remember this being one of the first things I had to learn in my first "real" job. Like someone literally had to tell me there's not much of a difference between coding six hours in a day and one. Later on I learned there's just a class of tasks that just take time for your unconscious brain to break it down to understand it. Algorithms are like this. A lot of things that have unintuitive physical components are like this, e.g. bending on harmonica. Some things you just have to show up every day, give it your best effort and then something will click. Programming is like that.