The best takeaway from that book is the "cycle" of habit: cue -> routine -> reward. The message of the book is that if you have a bad habit, e.g. smoking, there is a "cue" that causes you to engage in the "routine" of smoking, for the "reward" of nicotine. Unfortunately, these cycles are hard wired into our brain, so once they're fully established, we can't change them. The author offers the solution: keep the "cue" and the "reward," but change the "routine." The first step is recognizing the cue. Once you know what it is, you can replace the "routine" with something more benign, that also leads to a reward.
So for procrastination, maybe the "cue" is your code compiling, and the "routine" is typing "n -> down -> enter" into your address bar to get to hacker news, and the reward is some sort of stimulus. You can fix this habit by recognizing the "cue" of code compiling, and swapping it out for a new routine, like 30 pushups, to get a stimulus reward of energy.
So for procrastination, maybe the "cue" is your code compiling, and the "routine" is typing "n -> down -> enter" into your address bar to get to hacker news, and the reward is some sort of stimulus. You can fix this habit by recognizing the "cue" of code compiling, and swapping it out for a new routine, like 30 pushups, to get a stimulus reward of energy.