Compare the sun and the fossil fuels as the sources of energy.
Coal and petroleum are fossil fuels they are obtained from deep under Earth’s crust. They are directly available to human beings for use. Therefore fossil fuels are the direct source of energy. But these are limited in amount also they are non-renewable.
Sun is also a direct source of energy. But it is renewable source of energy. The Sun has been shining for several years and will continue billions of years more. Solar energy is available free of cost to all in unlimited amount.