How do body get energy from food?

When u eat food your body takes out the calories to burn. That is wat produces energy. However if have to many calories at one time your cant burn it fast enough and will eventually becomes fat