A couple of people have pointed out that losing weight is simply a matter of expending more energy than you eat. For the sake of those on this forum trying to lose weight, I would like to point out that while this statement is pretty undeniably true from a simple thermodynamics perspective, the human body is a complex system, and therefore the implementation is not nearly as simple.
For example, increased physical activity leads to increased hunger. The body wants you to replace those calories that you just burned off, to get back to "normal". Unfortunately, an overweight person has a damaged metabolism, and "normal" is fat. So, an overweight person will frequently exercise and then quickly eat back all of the expended energy, due to ravenous hunger. If you know any fat people that you see in the gym working out every day and not getting any less fat, you know what I am talking about.
This is where the "all calories are created equal" idea starts to break down. Your body's hormonal response is not the same for all foods. Low carbohydrate diets, for example, have been shown in many studies to be spontaneously calorie limiting. That is, people who eat a high fat, moderate/high protein, low carbohydrate diet simply eat less. They do so automatically with no calorie counting whatsoever. This has to do again with hormonal signalling. Fat and protein cause a greater release of PYY, which is a satiety hormone, during digestion. That may be one reason. Improved leptin signalling is probably also a key component (Leptin is secreted by fat cells and tells your hypothalamus how much energy your body should be storing or burning. The hypothalamus of fat people is resistant to leptin, so while the body is awash in it, the brain does not know to stop eating.).
Additionally, all carbohydrates are not metabolized the same. Glucose digestion causes the suppression of the hunger hormone ghrelin, while fructose metabolism does not. And, probably more importantly, glucose can be directly absorbed into your muscles to replenish glycogen, but fructose must be processed by the liver. It cannot be utilized by any other cells in the body (actually I think sperm cells use it, but that's pretty irrelevant here). Excess fructose increases triglycerides and damages leptin signalling in the long term. Keep in mind that table sugar (sucrose) is 50% fructose.
So, if a person wants to lose weight efficiently, a diet high in healthy fats (that's saturated and monounsaturated fats, not polyunsaturated fats from vegetable and seed oils which cause systemic inflammation and weight gain), protein from animal sources (preferably grass fed or wild caught, because the grain-fed contain high Omega-6 PUFA), and vegetables, but free from sugar and refined carbohydrate is a good idea. If weight loss is the priority it can stop there. If on the other hand we are concerned with optimal athletic performance, a post-workout meal from a starchy food, such as a yam or sweet potato, will serve to replenish muscle glycogen. Starch is essentially glucose, so we do not have to concern ourselves with the pitfalls of fructose metabolism.
If, on the other hand, you already have a healthy metabolism, and can eat anything that gets put in front of you, without gaining any weight, enjoy it. Some of these foods though, may be slowly damaging your body internally, causing chronic low-level systemic inflammation, and ultimately leading to heart disease later in life. Maybe not. There is a lot of genetic variability when it comes to that stuff. Hopefully that is helpful to somebody. Educating myself about the human body, and basing my dietary choices on that has been a life-changer for me.