Here’s the core idea that changed my perspective on productivity: Action leads to motivation, not the other way around. You should not check your email or scroll Instagram while you wait for motivation to “hit you.” Instead, just start doing something, anything, that makes progress toward your goal, and you’ll find that motivation will follow.
For example, if I have a high-priority, complex bug-fixing challenge at work, my approach is to decompose the problem into something much simpler. Could I simply add a log statement that prints the value of a relevant variable? My goal at this point is not to solve the bug, it’s simply to take a tiny step forward.