Back when I was in Delhi and living with my parents, I made my own diet rules that allowed me to give in to temptation on weekends, provided I ate mostly fresh fruit and vegetables for lunch the other five days, and avoided anything sweet during the week. When I was at home or out with friends on the weekend, it was very difficult to ward off temptation because there were so many triggers - cookies, cakes, chocolates, and any other kind of dessert you could come across. But in our cafeteria, the food was not much to trigger any temptation whatsoever, except perhaps the infrequently served fruit custard.
But now I am at home most of the time, and I have full access to everything I would ever want to eat. Now I have to make other rules. Here's what I do. I don't keep anything chocolaty, or with a high fat content, in the house. It takes only a mild, momentary form of self control to walk away from the cookies and the puddings at the grocery store. But it saves me a lot of trouble, trying to control temptation when I know that there is a box of chocolates in the refrigerator. If I feel like eating something of the sort, I eat it when we eat out. Which is mostly on weekends. I do have some amount of dark chocolate lying around in the house, but that's only about three hundred grams that we bought around the time I came here and there's still some left. I do eat it sometimes, but I try to keep a bowl of easy to eat fresh fruit (raspberries, strawberries or grapes) on the table, so that I see it before I get to the kitchen, before I open the refrigerator or any of the kitchen cabinets which may hold something else that may be edible. Raspberries, grapes and watermelons work really well for me for this kind of thing. Cutting the watermelons is sometimes too much work, so I tend to store it cut into bite sized pieces. I try to store the berries and grapes washed and stored in a bowl in plain sight, so I can see them as soon as I open the refrigerator.
All said and done, I do have my moments of weakness. That's why I buy dark chocolate, because it's better for health than milk chocolate, and whole grain cinnamon bars. Now those are yummy and they are good for you!