Well, I guess these habitual behaviours are fulfilling some sort of need/urge. Those urges will happen to you again and again, just as part of life. The problem isn't the fact that you feel {sad, bored, lonely, whatever}, but that your brain is used to jumping to some particular ways to deal with the situation. Brains just do this. They like to streamline things, so they can be as energy-efficient (non-thinking) as possible.
But just like hunger can be solved with chocolate or cheese or chives, other urges can also be met in different ways. Try to catch yourself in those urges, and wind back the thought process to find the feeling that initiated it. And try to do something else instead that will address that urge. e.g. If you feel lonely, call a friend. If you feel bored, do something exciting. Sometimes I do this and I don't even know what to do to deal with my feeling, so I just google it; e.g. "What to do when feeling {lonely, like a rat in a cage, like nothing is fun, whatever}", which always comes up with some good suggestions. That's one thing to try, anyway.
It is a *process* to change habitual behaviours, so you most likely WILL fall back to the behaviours again and again. It just takes time, and getting back on the horse, again and again. Don't beat yourself up when you have slip-ups. Just think "Ah, well. There's a slip-up. All part of the process. And now.. on we go, forward.".
With smoking in particular, people are more likely to quit if they use nicotine patches or some other nicotine replacement therapy. Your doctor can help you with this.
For now, you're exhausted. That's okay. People are exhausted sometimes.