Since I lost 50 pounds last year, some people have asked me how I did it. This is how.
I only eat between noon and 8 pm. (At first I did this accidentally and not very precisely, just by skipping breakfast except for black coffee. But now it's deliberate, as apparently it's a form of intermittent fasting which is good for you somehow.)
I have a calorie budget of 1,586 calories per day, and I try not to go over it. I track what I eat with the app "Lose It!". Part of calorie tracking is coming to grips with guesswork and imprecision. You just hope the errors balance out any are not always in one direction or other (you don't want to sneakily overeat, nor pointlessly starve yourself). The main benefit of using a calorie-tracking app is that it makes it harder for you to deceive yourself with small little snacks and so on.
Learn about what foods are filling / satisfying but don't have too many calories. For me, it's plain greek yogurt. If I want some sweetness, I like to add raisins or honey. Contrariwise learn which foods have a lot of calories but leave you hungry. For me that's mostly carbs.
All things being equal, I try to avoid eating too much crap (too many carbs, candy, beer, etc) but I don't have a rule against anything in particular. Everything just gets tracked.
I drink a lot of Diet Dr. Pepper in the day and herbal tea at night. I don't know, these help. Celestial Seasonings' line of Zinger teas sort of taste like dessert.
Exercise is great and everyone should do it all the time. But I find that even if my various workout apps tell me that burned for example 300 calories running, and then I eat an additional 300 calories that day, I'll actually start to gain weight. Maybe this is because when people exercise they sometimes fidget and so on less throughout the day, balancing out the increased activity, or maybe it's because I just don't burn as many extra calories exercising as I think. Who knows. So I only allow myself to eat about half the calories I've theoretically burned through exercising, which is hard, because exercising makes you hungry.
If you fall off the wagon it's pretty easy to get back on again. I gained some weight over the holidays but am losing a little bit each day in January. Eating more makes you hungry more, so there's a bit of a negative feedback loop here. I've found that the best way to get back on the wagon is to "reset" by doing a 24-hour fast (which just means skipping lunch, since I already don't eat breakfast).
Guess what. Your daily calorie budget for losing weight may likely, at some point, become your daily calorie budget for maintaining your current weight. It's not like you can diet, lose weight, and then start eating more. Sorry!
Finally, why did I gain so much weight such that I have to do these things? Getting older. Office job where one of the primary daily activities is lunch, and where people always bring in treats. Snacking at the desk. Bad eating habits formed by many years of not being able to gain weight no matter what I ate. It happens.