Willpower shows up too late. The habit has already started.
A habit fires the moment its cue appears, so the fix is to kill the cue before the routine can begin.
A snack bowl sits 1 reach from your keyboard? Move it out of the room, and you delete one automatic prompt to eat.
The craving may still come, but now reaching the snack takes a deliberate search instead of a glance.
So change the cue, not your willpower. Find the object, place, or time that starts the behavior, and remove that first.