The sun is perfectly fine, but for generations, not a single human has seen sunlight. Earth is completely covered in black fog, reaching high up into the atmosphere, so that not even skyscrapers can escape it.
The fog is actually made of microscopic organisms. In the upper layers of the atmosphere, they photosynthesize. Dead microbes eventually drift down to the ground, creating a rich black soil that feeds fungus and other lifeforms.
Across the whole world, the fog utterly blacks out the sky, and even at ground level, it is dense enough to limit visibility to under a hundred feet, even with a powerful torch (of course, since there is no sunlight, a human would need some artificial light source to see at all). This level of fog is roughly similar to a perpetual Tule fog.
The problem: thick atmospheres lead to greenhouse conditions on a planet, but Earth must remain habitable for human-like creatures.
How can I keep our world from turning into a Venusian hellhole?
The fog is genetically engineered by a sufficiently advanced intelligence, so any hard science answer is acceptable.