There’s also fuel cells, where fuel is not burned to create steam to move something, but combined with oxygen in a different way (the end products still being the same) so the electrons shuttled around during this reaction can be utilised as electricity. Think of combustion as oxidation of your fuel, the oxidation meaning that you (among other things) move electrons from the fuel to oxygen. In combustion, unfortunately you can’t access the electrons directly, as they are always stuck in the chemical bonds of the molecules, that’s why we take the detour via heat/mechanical - the steam engine. The fuel cell now separates fuel and oxygen, and thus divides the combustion reaction into two parts that happen at opposite sides of the cell. Those sides are divided by a membrane that does not allow the electrons to transfer across, so they need to take a detour through an electric circuit, in which we can harvest them as electrical power.
I always found it really fascinating that fuel cells are the only other technology than solar where the electrons we use as electrical power are more or less directly generated as opposed to the detour via a generator. Unfortunately, fuel cells are still a very niche technique.