Hit them head-on.
Health and nutrition advice commonly involves "removing" or "restricting" something. Cut out this, cut out that, cut it all out...
The problem is, the more we restrict ourselves, the harder it becomes to avoid these deemed "bad foods", with your lifestyle becoming incrementally less free (and fun!).
My advice would be to find moderation with all foods, so you never find yourself in a situation where you receive some kind of "backlash", whether that be physically or mentally, when you eventually encounter them.
For example, if you cut out carbs or salt, without a doubt you will encounter them (or want them), but because you've restricted them, eating them would result in bloating, water retention, and likely guilt.
If this list of "foods to avoid" grows, so does the number of encounters, and the amount of backlash.
On the other hand, if you consume a balanced diet with no "bad foods" - you hit them head-on - your body will be accustomed to this freedom and you never suffer the backlash.
Moderation is the key.
As always, there are limits to this. If, for whatever reason, you do ACTUALLY want to restrict something (i.e. refined sugar to rebalance your gut bacteria) then you may like to be a little more strict - this advice is for the bigger picture of your nutrition.