Bad habits can be very hard to break for several reasons. But with some simple techniques they can be made easier to break. The key thing is to start right now to change the neural pathways in your brain.
Most experts agree that it takes at least 21 days for a habit to form. What you don't hear most times it that the longer you have had a bad habit the harder it is to break. What happens is that each time you perform a certain habit that neural connection for that habit gets stronger and stronger in your brain. So the longer you have been doing a certain bad habit the harder it is to break.
It does take a lot of will power to change bad habits, but by trying to improve a little bit each day eventually you should be able to stop doing that bad habit.
An example of trying to extinguish a bad habit is to change your mind's state. Usually when you perform a bad habit your mind is in a certain state. Once you recognize this you will be able to interrupt your pattern of performing this bad habit.
To change your mind's state, do a quick exercise, go outside, or listen to some loud music, anything to get your mind to start thinking about something else.
Another thing you can do to counteract this bad habit is to form an opposite positive habit. For instance if you tend to raid the fridge at night, try to replace the non-healthy food you eat at night with fruits that you like to eat.
There are a lot more techniques for changing your bad habits, but the main thing is to try and improve even just 1% a day. Over the course of the year you will notice a vast improvement.