The provide direct energy because they help it grow plants and when plants grow it helps us live.
But it also provides indirect energy because the sun can cause droughts which is bad because with droughts we dont have enough water to water the plants and with that they dry out and die.