Food is a fuel and everyone needs to eat to get energy. But you have to look at what's in your food.
All food and drink except water contains calories. If you eat more calories that you need then those calories aren't used the body stores it as fat.
If you eat loads of extra calories, like a big chocolate bar, you should try and do some exercise to wear off that energy before it turns to fat.