In ways that are very mysterious, certain behaviors appear to be constrained rather than freely chosen. The obsessive compulsive or the addict do not appear to be choosing their actions, any more, but acting on the basis of compulsion, even though the compulsion is coming from the self.
Habits that line up with important life goals, though, appear to be freely chosen. So if I know I must do something to achieve my goal, I will be acting freely.
The best way to eliminate bad behaviors is to simply eliminate the time in which they occur by doing something better in that time. You will experience a sense of freedom, even if you schedule your time quite rigidly, because you will have chosen things that line up with what you really think of as meaningful to you.
You cannot change your behavior by first waiting for your cognition to be in the perfect state. Instead, I suggest first changing the behavior, and letting your brain figure out the benefits later. The mind might very well be the weak link, here. Bad behavior sends a signal to the mind to have bad thoughts. With my two good friends who are zen masters (although I haven't spoken to them much about zen it comes up a bit in conversation in various ways), I have noticed that they emphasize the practice. That word comes up both as noun and verb.