[Energy from food] minus [Energy spent through activity] equals [Energy surplus that will be stored as fat on your body].
So, if you eat more energy than you spend, you will gain weight. If you spend more energy than you eat, you will lose weight. Then it stands to reason that the way to lose weight is to eat less, be more in activity, or a combination of these two.
Usually people have a strong aversion to reduce the amount of food they eat or to exercise more, so they seek more advanced methods, like not changing the amount of food you eat but the sorts of food you eat (preferentially towards foods with less biologically available energy) or when you eat (i.e. to control hormones that affect fat storage) and the way they exercise (methods that will cause high metabolism 24/7), etc.