Answer:
By consuming plants and animals.
Step-by-step explanation:
Since plants are autotrophs, they absorb the sun's energy through photosynthesis and make glucose. herbivores (plant eating heterotrophs) then consume these plants and gain energy from the glucose and further up the food chain carnivores consume herbivores and also gain a bit of glucose from them.