Integrate a substantial calisthenic exercise into your daily routine.
Something like a hundred pushups and a dozen pull-ups. Increase the count as you get lighter and stronger so you're always within 10-20% of the maximum you could do in a set.
Make it a non-negotiable part of your day akin to brushing your teeth and showering.
This way when you fuck up your diet/lifestyle, you have a very strong negative feedback signal when you suddenly can only do 75% of the e.g. pushups you did last week.
When you work on this for years and get your sets up in a range that feels hard-earned, it becomes quite upsetting to see the numbers regress.
For me this is all it takes to correct any emerging bad habits that start putting on pounds like drinking socially too much or eating cookies at the cafe.
It's easy to ignore a slowly increasing number on a scale, assuming you even step on one. Not so easy to ignore yourself sucking at this thing you've been getting awesome at for years. Not for me anyways.