The first step in breaking a bad habit is to look at why you find this action so compelling. In other words, what's the payoff for doing this seemingly negative thing? Since you've already classified this as a "bad" habit you may be tempted to say there isn't one. But look closer. There is always a payoff. Let's say your bad habit is yelling at your kids. What's in it for you? You let off some steam and feel a little better for the moment. Or you have a bad habit of leaving the dishes unwashed? The payoff could be that you get to spend more time on the Internet!
Next, take a look at the trade off. What is it that you are losing by exercising your habit? This step should be easier. Just think why it is that you consider it a bad habit in the first place. Yelling at your kids is a bad habit because it leaves everybody feeling tense and tears down your children's self-esteem. You are trading a temporary release of tension for the emotional health of your children. Leaving the dishes undone is a bad habit because your kitchen is a smelly mess. To have more Internet time you are trading off having a pleasant living environment. When you look at it that way it doesn't seem like you are making very wise choices, does it? There has to be a better way.
Now that you've weighed both sides of the issue--your payoff and your tradeoff--it's time to make a choice. It's no longer an involuntary act because now you know that you are making a choice every time you perform this action. You are choosing what you value more: the payoff or the tradeoff! Each time you start to do whatever the bad habit is now you have to actively choose. Which do you value more? Do you value more the relief you get by yelling at your kids or do you value their emotional well-being? Do you value more having more Internet time or having a pleasant place to live?
The whole reason you formed your habits in the first place is that they filled a need. You had tension that needed relief or you had a desire to surf the Net. As you break the old patterns you still need a way to fulfill these needs. You will be not only making an active choice to not do the old action you will also be making a choice to perform a better, alternative action in its place. Instead of yelling at your kids you might decide to go for a run every time you are feeling tense. Instead of letting dirty dishes pile up you may decide to use paper plates when you are eating alone. What the new habit is that you substitute isn't so important as whether you feel good about the choices you have made. After all, the reason you consider it a bad habit is because it leaves you feeling bad about yourself.
By now you should realize that the only way to continue with a bad habit for very long is to sink back into denial of why you are doing it in the first place. Each time you begin to resume your old patterns the thought will pass through your mind that you are trading X for Y each time you perform that action. You will be forced to make a choice, whether good for bad, about continuing your habit. What choices will you make? The one that makes you feel bad about yourself or the one that makes you feel good? It's up to you.