That’s a great question.
Really what we try to do is mimic what plants do in photosynthesis.
They take the energy in sunlight and use it to break strong chemical bonds in carbon dioxide and water (and also make weaker bonds in glucose and oxygen).
We try to do similar things where we break the bonds in water (to generate hydrogen – a fuel) and oxygen or where we break the bonds in carbon dioxide and water to generate fuels such as methanol or ethanol.
In plants these processes happen in chloroplasts in plant cells while we try to use catalysts to do the same thing.
These catalysts can also be used to turn solar energy into electricity.
I hope this helps and thanks again for the question.