Count calories and see what intake/burn limits works for you. It is really important to move daily and DO NOT skimp on water.
I used to have a nap every day at ~6-8pm. After day of coding I was doing it just to rest my head and eyes, or sometimes to get over a headache. Had this habit for at least 5 years and it was really wrecking my daily routine. Work, nap, dinner and slouch till sleep. I gained over 35kgs (77lbs) during that time. And once i saw 100kgs on a scale, I decided that it can't go like that any longer.
Replaced nap time with active time. Got a treadmill at home so there was no excuse to blame bad weather and get lazy. And I started counting calories. Made a rule of less than 2000 daily intake and at least 3000 calories burned daily and tried to stick with it. I try to eat healthy food, but do not avoid junk food completely. I just cut it by a lot. Hamburger with a drink and fries can easily be 500-800-1000 calories. Be aware of it and plan your daily intake accordingly. But I notice that with time passing, the cravings for sugar or quick food is diminishing.
It's been 3.5 months since I started it, and I went from 100kgs to ~92 (haven't seen 92.x for several years).