For me, losing a bunch of weight was as simple as cutting out big sugar bombs and alcohol. After about a month, anything that could be classified as a "dessert" became cloyingly sweet and gave me indigestion. I pretty much eat whatever I want otherwise.
I don't know how much weight you lost, but I can't imagine it was all that much if all you had to do was cut out sugar and booze, unless that was the majority of your caloric intake.
Encouraging this shift is largely how eating disorders are treated; though in my case it came as a result of dealing with a lot of trauma that I had buried. But ultimately it's about holistic emotional and physical health, and reframing your relationship to food in that context.
Even if it is only 10% of the caloric intake, it works. Obviously not for losing 100kg, but a 200kcal deficit per day (one less dessert or one bottle of beer) adds up to 10kg weight loss within a year.