In fact, current research indicates it's a pretty poor strategy (in terms of effectiveness). Rather than focusing on how to force oneself to a right choice in difficult (tempting) decisions, better to make it easier to make the right decision — through rewards, through force of habit, through alignment with other desires/values, through avoiding the need for such decision-making.
Makes sense to me. In the last example, I try to avoid having cookies in the house — or, if in the house, out. Because I know, for myself, that I'm much more likely to snack on a cookie (and then another, and then another) than, say, pie or ice cream. (The curse of "Fun Size" candy at Halloween isn't that they are smaller than full-size candy, than that "Fun Size" is so easy to trivially eat … repeatedly).
Interesting stuff.
The myth of self-control
Psychologists say using willpower to achieve goals is overhyped. Here’s what actually works.