Learning to control your diet solves both problems.
I'd also argue there's a lot of value in learning to not be dependent on medication to control your behavior, because it's not available in most situations.
You can't take an exercise pill.
You can't take a career success pill.
You can't take a "hard, but necessary conversation with my partner" pill.
Those all require you to consistently do things you at times don't want to do, just like avoiding junk food.
You have to actually kick your ass when you exercise. Most people don’t push that hard. Michael phelps ate what 6k calories a day or something crazy to maintain his prime form with the amount of caloric burn he was doing in training. If he continued to eat like he did in those crazy olypmpian training years, he’d be morbidly obese. If he ate like he does now in those years, he’d starve.
For the average person it's much harder to exercise out of a bad diet than just change the diet. I think it's an easier "sell" for most people to start off trying to eat less than to keep eating the same way and jump right into "kick your ass"-level exercise.
It's a real killer for "calorie blind" people to go on a 750 calorie hike, and then stop by for a "treat" on the way home. That treat being a 500 calorie blueberry muffin with 200 calories of butter on it. Then they go home and have dinner.