Aristotle and the ancient Greeks wondered about how to achieve eudaimonia, the happy life. A better way of translating it would be "human flourishing". Not just simple happiness or base pleasure, but a full, satisfied, aesthetically and philosophically complete state of being. One of the things they recognized as a stumbling block was akrasia, lack of self-control, acting against your better judgement, lack of willpower. For example, going to the gym and working out will improve your overall health and fitness, but eating a 500-calorie cupcake will make you happy right now without having to sweat for 45 minutes. Which one takes willpower to achieve?
Fast forward a few thousand years, and science steps in to help fill out the picture. It turns out that we actually have a limited supply of willpower. You can only resist temptation for so long before you give in and indulge. That's why it actually is a good idea to empty your home of all the temptations you're trying to avoid. When the temptation is staring you in the face, it's slowly emptying your willpower-tank of fuel. Then it's empty and you give in. And lots of things empty the tank, all of them the things we'd like to do. Saying no to a drink (or another drink). Saying no to food. Saying no to sex. Good lord... Fortunately, there are ways to help!
First, one of the things fueling willpower is glucose, sugar. A little bit of candy will provide you with the boost you need to tell your ex where to shove it when he shows up drunk and horny. But what if you need willpower to say no to sweets? You're kind of screwed. This explains why dieting is hard; you need sugar to say no to sugar. Catch 22.
Except! That it turns out Aristotle was right about something for once! Willpower actually is like a muscle. Use it or lose it, and in using it, improve it! By making it a point to expose yourself to temptation and resist it, you'll make it easier to resist temptation in the future. Sure, you can wear yourself out just like at the gym, but a smart workout plan will let you build up strength without wearing yourself down in the process. So if you need to be better at dieting, then change your route to work so that every morning you walk by that awesome bakery, and stop, and stare, and smell that delicious, wonderful smell... then keep on walking. It's probably better to have a different route home, though, because at the end of the day you'll be tired, your blood sugar will be lower, and it'll be harder to resist those donuts. Do this when you're not dieting and it'll make dieting that much easier.
So what's your Achilles heel? What do you need to learn to say "No!" to? Find a way to expose yourself to it in small doses and controlled circumstances and say "No!" to that. Then increase the dose to improve your control.
Something that's really good for everyone is that exercise improves willpower. The link between the two hasn't been elucidated, but who cares? Going to the gym and getting fit improves both body and mind; hop to it! This might explain why it gets easier to work out the more you work out.
Here's another strange thing; using your non-dominant hand1 to perform tasks will help. You don't have to learn to write with your off-hand or play the violin; even simple tasks will help you with this, like eating with your off-hand. My guess is that Just switching to a different hand forces you to concentrate on what are normally mindless tasks, meaning you bring willpower to bear. But that's kinda just making stuff up. The important point is that it works.
Bad news for atheists, polytheists, and secularists; being a believing, practicing member of a monotheistic faith helps your willpower. Because they spend their lives saying no to everything worthwhile in life.
And there's a website for you: http://www.stickk.com/ . Essentially you make a bet, get a friend to keep an eye on you, and use the site to keep track of everything. If you lose, you pay, and adding a concrete, immediate cost can make a nebulous, abstract goal immediate and easy to stick to. You don't need the website for this; just make the bet with a friend and make sure he's unscrupulous.
And Apps! There are apps you can download that will check if you're doing what you want to do. There's one that uses GPS to make sure you're actually going to the gym, and if you don't go for a long enough period of time... it takes money off your credit card and either sends it to people who are doing well, or to an organization you hate. Imagine knowing you're putting on weight and sending $100 to the Tea Party. Sure takes the jam outta that donut.
Now for some bad news. Your beliefs about your willpower can affect your willpower. So meta. But if you think your willpower can be depleted, you're more likely to give in to temptation. Of course, if you believe your willpower can be strengthened with practice, you're less likely to give into temptation. Oh, wheels within wheels. Also, any sort of work that tires you out will decrease your willpower, too. That's why it's easy to quit smoking every morning and buy another pack of cigarettes on your way home.
Now I'm going to have some fun: This is why Granny Weatherwax and Commander Vimes are so awesome. They want to be bad, but require themselves to be good. All day, every day they're resisting the temptations of their darker natures, thus after a lifetime of watching their behavior every moment, they're each living avatars of willpower. Death himself takes a respectful step back when Granny walks by, and Sam Vimes can fight a 10,000 year old quasi-demonic thing of pure vengeance to a standstill2.
Don't know what I'm talking about? Shame on you! Go spend money.
1 - The left hand, for the most of us.
2 - THAT! IS! NOT! MY! COW!