Using multiple senses activates more of your brain's processing power. This can be verbal discussion, fiddling with different objects, walking around, etc. Going somewhere new to feed your mind new stimuli also helps.
The brain has two basic modes, L-Mode and R-Mode. Effective learning finds ways to make use of both of them.
Linear Mode, L-mode
Rich Mode, R-mode
Symbols and abstractions
Remembers little but organizes it well
Remembers virtually everything without organization
Inner voice they always hear talking
Background voice we never hear
A good trick for making them work together is a flow that leads with R-mode and follows with L-mode. A snappier version is "Write Drunk, Revise Sober." Give yourself free creative reign in the start, then go back and edit the results into order.
The author gives rock-climbing as an example. The instructor set up their safety equipment and told them to climb on their own for thirty minutes. Everyone explored the rock walls on their own and got some direct experience. Afterward, the instructor came back and began giving them the usual advice on how to climb walls. With the information their R-mode was gathering in the safe, free-form exploring, information delivered to their L-mode made more sense since it had more context.
Another example is, when learning a foreign language, simply being exposed to lots of examples of the language with no context in the dark. This was the R-mode, and they then switched to L-mode lecturing to prioritize and organize everything it'd gathered.
Pair Programming also works on balancing these modes. The driver writing code is working in L-Mode, and the navigator watching them and looking at the larger scope is in R-Mode.
Another way to balance these modes is thinking in metaphor or creating understanding through unlikely associations. This also holds with humor.
Our R-Mode is always working and remembering in the background, and often already has the answers or ideas we're looking for. Accessing them is a challenge. It's not verbal and linguistic like the L-Mode, so they can rarely be put into words, so other methods are needed.
One way is image streaming, or asking yourself a question, closing your eyes, and closely observing any images that cross your imagination with as many senses as possible. Interpreting them is a potential way to see what your R-mode is trying to tell you without words.
Another way is free-form journaling, or writing out a pure stream of consciousness daily. This works best first thing in the morning since your unconscious is more active and you get an unfiltered look at your thoughts. Or you can gather interesting ideas for writing as you think of them throughout the day and pick them back up again when it's time to flesh something out. Always carry something you can record these gems on.
Going for a walk outside invites your R-mode to process more and bring more of those ideas to the surface. Be sure not to directly think of what you want to solve, simply bear it in mind as you walk. Writing all your thoughts down in a mental dump beforehand can help clear your mind.
Code is read many more times than it is written, so using patterns to make things more readable by humans has a lot of return value. This is the case for spacing variable declarations like this:
const person = 'Fred',age = 9;
These patterns take different forms to many people, so consistency and explanation are key.
If you have a hard time seeing or escaping certain patterns, try to turn your thinking around. Deliberately turn the meaning, intent, or quality on its head to see it in a different light as soon as possible. For example, debug something by thinking of several ways you could purposefully cause it. Other approaches are:
Look at it in reverse
Exaggerate an idea
Combine disparate ideas
Imagine something crazy
Don't assume there's only one right answer
Don't dismiss something as illogical
Don't dismiss "playing with an idea" as frivolous
Rearrange the pieces or elements in new ways to see new relationships
A way to push yourself out of mental ruts, in general, is to rearrange common life routines. Change the order or timing of common tasks to keep your mental wiring flexible and strong.