What helped me is brushing teeth a quarter after what is supposed to be the last meal of the day.
Then I know that, if I get a snack, I'll have to go through the teeth cleaning routine again, and the desire to not have to do that is stronger than the desire for the snack.
Then I know that, if I get a snack, I'll have to go through the teeth cleaning routine again, and the desire to not have to do that is stronger than the desire for the snack.