The capacity for self-control is like a muscle: It varies in strength from person to person and moment to moment. Just as your biceps can feel like jelly after a workout, your willpower “muscle” gets tired when you overtax it.
To strengthen it, pick any activity that requires you to override an impulse (such as sitting up straight when your impulse is to slouch), and add that to your daily routine. And take baby steps. Instead of going junk-free overnight, begin by eliminating, say, those chips you eat by the bag, and substitute them with a fruit or vegetable.
Hang in there, and sticking to your diet will become easier because your capacity for self-control will grow.