Some autotrophs use sunlight energy to produce their own food. This is because autotrophs use a process called photosynthesis to make their food. This process uses energy from the sun, as well as water from the soil and carbon dioxide from the air to create glucose.
However, other autotrophs perform chemosynthesis, which does NOT require energy from the sun to produce food.
Overall, not all autotrophs use sunlight energy to produce their own food, but a large chunk of them do.