My grandfather used to sit with me for an hour every morning and used to teach me maths.
He would focus on basics first. He would make sure I had the basics drilled in to me. Not just understood them, but mastered them. Then we would move on to the next topic.
It was a bit slow at first. But after a while, once the basics were done, I finished the whole year's math book in 2-3 months.
I have seen this in software engineering too. Once I am good at basics, or once they're drilled in enough, I am faster and quicker.
Drilling basics is basically like having the basics in O(1) look up with very reduced space complexity too. It reduces the amount of overhead your brain utilises. This makes your brain free to think about the actual problem you are solving. Also, I think this is what allows your brain to work in the background, even when you aren't actively thinking about the problem.