We let my son pretty much eat what he wants when he wants it. This works because we don’t really have a lot of junk food in the house. My husband and I don’t drink soda and I’m not much of a snacker, so we usually just don’t have a lot of stuff in the pantry. So, my son is addicted to apples, cheese, yogurt, etc.
I am, however, under no illusion that he’d eschew candy if it was given to him. I think if we set him down in front of a bag of sugar, he snarf the whole thing. This is evidenced by the cordial incident. My husband likes cordial - it’s kind of like Kool-Aid. We never let our son have any, so he was happy to drink his water while Dad got his sugar fix. One afternoon, my husband poured my son a little cup of cordial. It was all over. For days, my son would throw a tantrum when he realized all he had in his cup was water or milk or juice. He made elaborate plans to jump the baby gate in order to get into the cupboard where the cordial bottle was kept. He finally forgot about it, but we now have a special, dark hidey-hole where the cordial resides and my husband can only drink it after my son’s gone to bed. He sometimes sneaks some while he’s awake and has to go down to the laundry to drink it. It’s like he’s a teenager sneaking a few tokes off the bong in basement. Pretty funny.