Diets don't work because 99.9% of them focus on the immediete short term.
It's quite simple: don't worry too much about calories, just eat healthy. This is quite achieveable and why it works. Although many things like motivation, social contexts etc reduce its success rate.