Plants are photosynthetic. So, they prepare their own food by using raw materials from atmosphere like CO2, H2O and sun’s energy. CO2 is the carbon source for the synthesis of glucose through array of enzyme catalysed biochemical reactions taking place in chloroplast of plant cell.
Animals are heterotrophic in nutrition. So, they get energy; i.e. glucose from the food they eat. It depends on what is their food source. For example, herbivorous animals eat variety of plants, starch and cellulose of which become glucose source. Carnivorous animals eat other animals, whose stored glycogen or fat becomes energy source for them.