Answer:
The main function of a producer in an ecosystem is to make sugar through photosynthesis. Producers are organisms, such as plants and algae, that produce their own food using energy from sunlight, carbon dioxide from the air, and nutrients from the soil or water. Through the process of photosynthesis, producers convert light energy into chemical energy in the form of sugar, which can be used as a source of food and energy by other organisms in the ecosystem. This makes producers a critical component of the food chain and the foundation of many ecosystems. Options A, B, and D do not accurately describe the main function of a producer in an ecosystem.