Microorganisms can be divided into four types: photoautotrophic, photoheterotrophic, chemoautotrophic and chemoheterotrophic.
Among them, chemoautotrophic and Huaneng heterotrophic do not need sunlight, and they use organic and inorganic substances to synthesize substances needed in the body.
Photoautotrophic microorganisms: using light, inorganic substances and carbon dioxide;
Representative microorganisms (cyanobacteria, purple sulfur bacteria, green sulfur bacteria, algae)
Photoenergy heterotrophic microorganisms: using light, organic matter, carbon dioxide and simple organic matter;
Representative microorganisms (Rhodosporaceae bacteria, that is, purple sulfur-free bacteria)
Chemotactic autotrophic microorganisms: using inorganic substances and carbon dioxide
Representative microorganisms (nitrifying bacteria, sulfide bacteria, hydrogen bacteria, etc. )
Huaneng heterotrophic microorganism: using organic matter
Most bacteria and all eukaryotes belong to this category.
Above, I hope to help you.