I can tell how I keep myself away from junk food.
So basically one really gets inspired by what people around them eat, like your friends, family, and also where you live, like if you live in hostel, your chances of eating junk food increases.
Also, most of the junk food, like noodles is made of “maida" or refined white flour, which is not really good for health, especially if you consume it on daily basis.
So if you belong to the category of people who quickly gain weight, in such cases if you continue eating junk food, you will gain weight at an exponential rate,
But if you belong to the category of people who don't gain weight even after eating a lot of junk food, then what junk food really does to your body is that it reduces the amount of food you need to take to kill your hunger, meaning if your body requires at least 4 rotis(chapatis) and vegetables and pulses in a day, juck food can replace it by only one plate of noodles. Now in such case, a person will not gain required weight, suffer from lot of health problems like low BMI, undernourishment, and girls will suffer from irregular periods, etc.
Well you may get inspired by how stunning Deepika Padukone looks in those short dresses, or you may have to impress someone, or you may be suffering from health problems and want to get rid of it, etc.
Also, I'm not a dietician or a doctor by any means, these are just my personal experiences but are very effective.