Goal Management Training
A short mental routine you run the moment a task gets away from you. Learn the five stages until they're automatic, and "drifting off" becomes a cue to start them.
Stage 1
Catch yourself. Interrupt the autopilot and orient to what's actually happening right now, before you do anything else.
Stage 2
State the main goal of the task in a single, plain line.
Stage 3
Break that goal down into its sub-steps.
Stage 4
Hold the steps in mind, learn the sequence, so you're carrying the plan, not improvising mid-task.
Stage 5
Ask whether the result matches the goal you set. If it doesn't, run the five stages again.