The theory of diet is quite simple - you consume lesser calories you lose weight. Meaning that if your calorie intake is lesser than what the body needs, you will lose weight and if it if the opposite, then your body will store the excess in the form of fats and you would gain weight.
But, saying so, have you all heard of the term 'negative calorie'? Well, obviously it has to do with your food, but still if you have not, then let's know it, as it could be the last resort for them, who have been struggling with their weight loss regimes for years unsuccessfully.