I have little willpower, so I have to remove the ability to get the foods and snacks that are bad for me. If I take money with me to college, I will spend it on chocolate etc. in addition to my lunch, so now, I take only notes for an emergency and therefore have no change to spend in the machines.
Another bad time for me is 10-11 pm, I usually search for snacks, so I've taken out all the biscuits and left only fruit. Sometimes, just a cup of tea when I'm peckish can relieve my need to snack. Mints such as tic tacs during the day may help when you feel like a snack.
Unfortunately, it doesn't always work so well; I needed to buy a bottle of water and threw in a chocolate bar too today, but compared to how much I used to eat in chocolate and crisps, I'm still cutting down this way. No change, no food from machines, just my healthy lunch that I've taken.