Food contains energy. Exercise requires energy. We feel great when we're full of energy. But are we talking about the same thing in all three sentences? We aren't, so let's clear up the confusion.
First, a quick stop in physics-land. Here, energy is the capacity to do work. If you apply one newton of force to move an object one metre, you have done one joule of work. Each kilowatt-hour on your electric bill is 3,600,000 joules. Each "calorie" (really a kilocalorie) in your Snickers bar or your salad is 4184 joules, or 4.184 kilojoules.
Calories are a measure of energy in this sense. After all, food is fuel. Just like you can talk about the calories or joules in a chocolate bar, you can talk about the joules in a can of propane or in a log of firewood or in a battery. It's all stored energy.
When you "burn calories", you're converting the energy in food (or in your body, for example your stored fat) into a different form of stored energy, which you may remember from biology class as ATP. And then that ATP can power important things in your body like contracting your muscles or helping your brain cells communicate with each other. This is what we do with the energy (calories) in our food.
Feeling Energetic Has Nothing to Do With the Physics Sense of Energy
Usually, when we say we have "energy", we're not talking about physics. We're talking about how we feel. If I had a good night's sleep, I might wake up full of energy. If I just finished a 5K run and totally feel like I could run five more, I'll be happy that I have a ton of energy. If I had a long day of work and running errands, and now it's the evening and I just want to collapse, I might look at my four-year-old zooming around and say, "Ugh, I wish I had his energy."
None of these feelings have anything to do with joules and calories. In this case, when we say "energy" we mean a lack of fatigue. How do you get this kind of energy? By not doing things that result in fatigue. A good night's sleep wards off fatigue. Keeping a positive attitude, or listening to upbeat music, can make us feel less fatigued. Light or moderate exercise can beat fatigue and help us feel more energetic.
We conflate these two ideas because you can be low on both kinds of energy at once. At the end of a marathon, you'll have run out of glycogen (stored energy in your muscles) and also feel very tired. But most of the time, these two ideas have nothing in common.
High Energy Foods Are Simply High Calorie Foods
It's all too easy to confuse food energy (calories) with the energy we feel on a good day (lack of fatigue). That's where you get into traps where it sounds great if your food is "energy dense". Or maybe somebody tells you to eat foods that "provide energy" for your body. What kind of energy does that mean, again?
Remember, the only energy a food can have is measured in calories. A large chocolate milkshake has a ton of energy: Eight hundred and forty (kilo)calories or 3,515,000 joules. Will sucking down that milkshake, perhaps alongside a 690 calorie bacon barbecue burger, make you feel energetic and on top of the world? Uh, nope. It's full of energy, but not that kind.
Exercise Uses Calories but Gives You a Feeling of Energy
OK, so what about exercise? You need to burn calories to power your muscles, so in that sense exercise uses up energy. If you exercised a ton, and didn't eat anything, you'd waste away. However, that doesn't mean you should avoid exercise in order to have more energy.
In fact, exercise actually gives you more energy, in the sense of a feeling of awesomeness. You burn calories, but you feel great about yourself. If you're not sure about this, try exercising in the evening, after you've had dinner and some time to digest it. You'll come home at bedtime, but you'll be wide awake because, hey, you're full of energy!
Don't feel bad if you were confusing the physics sense of energy with the feeling-great sense of energy until a few minutes ago. It's a super common misconception, and now you know better.