Psychological, and difficult to change. But there's hope.
It'll take some picking of your brain. Note taking, and possibly further understanding of yourself.
Sometimes it comes down to will power alone.
It's also important to realize what works for you, and what doesn't.
It's important to analyse your life situation and what causes you to do what you do. Knowing the reason for your habit can be a good start, (if you don't already know).
Finding what triggers you is also very useful. What you expose yourself to will become part of your subconscious. Big thing here is the images you see. Be careful what you're fueling your mind with. Our choices are very much based on how we view the world, so it only makes sense that by changing what we think about, we can change what habits we have. It's about directing focus to something else long enough to override the urge to continue a bad habit.
Giving it up completely = Challenging, but possible.
Giving it up, AND REPLACING it = more effective.
Strive on everyone. Good luck.
Contact me if you need advice. Cheers. - Chris