A lot of good comments here. I'll add mine:
I think that what @Eric Hassan said is very important: counting not only calories but also macronutrient ratios (protein, carbs, and fat) is very important for two reasons:
1. Not all foods have the same number of calories. There are some foods of which you can eat a lot and not eat that many calories; however, other foods, even "healthy" foods, can be very high in calories. For example, if you Google the nutrition information for 100 gram servings of foods, you will see that per 100 grams:
Tomato: 18 calories
Apple: 52 calories
Banana: 89 calories
As you can see, for the same amount of food (as weighed in grams), you can eat a lot more tomato and apple than banana. That doesn't mean that you shouldn't eat bananas if you want to lose weight: you definitely can (they are a good source of potassium, inexpensive, always in-season, etc.), you just have to be aware that they are more calorific than almost all other fruits and vegetables.
2. Even though a lot of people have had success with low-carb diets, the scientific research actually suggests that your body more easily stores a fat surplus than a carbohydrate surplus. In fact, there is a study published in the American Journal of Clinical Nutrition showing that in a 14-day study in which people were purposefully overfed calories, one group overfed with carbohydrates and the other overfed with fat, the group overfed with fat gained MORE bodyfat than the carbohydrate group. The difference was especially pronounced in the beginning of the study since humans have to fill up their muscle glyocgen stores in order to convert a significant amount of carbohydrates to body fat. Here is a link to the study: https://www.semanticscholar.org/paper/Fat-and-carbohydrate-overfeeding-in-humans%3A-differ-Horton-Drougas/cfd2e37527960bd37f0e011c7e0e3aca55eee9ee
Research into de novo lipogenesis, the conversation of carbohydrates to body fat, suggests that most of the body fat on a person's body likely comes from dietary fat and not dietary carbohydrates, so the results of the study aren't surprising.
Also, if you look at the issue from an anthropological perspective, high-carb, low-fat cultures (ie. Japan and other Asian cultures) have much lower rates of obesity than Western countries in which many people eat diets combining a lot of carbs with a lot of fat (pizza, pasta with cheese, hamburgers, cake, etc.).
Once again, I'm not saying that a low-carb diet won't work: it definitely can. However, the scientific research indicates that carbs may not actually be the enemy: the enemy may actually be COMBINING high-carb WITH high-fat.