There's a super short distilled version of my method for training cognitive habits, and I call it "The Art Of Noticing".
Skills I have so far trained using Noticing, with very little reliance on any other technique, include empathy, not trudging uselessly ahead when I'm trying to learn something but have gotten lost, and anti-"guessing the teacher's password".
The Art Of Noticing goes like this:
Answer the question, "What's my first possible clue that I'm about to encounter the problem?" If your problem is "I don't respond productively to being confused," then the first sign a crucial moment is coming might be "a fleeting twinge of surprise". Whatever that feels like in real time from the inside of your mind, that's your trigger.
Whenever you notice your trigger, make a precise physical gesture. Snap your fingers, tap your foot, touch your pinky finger with your thumb - whatever feels comfortable. Do it every time you notice that fleeting twinge of surprise.
Noticing is not the end of the story. But I am astonished by how much of the story it appears to be. In many situations, merely Noticing is well over half the battle, and what's left automatically works itself out on the fly.