But it is also very inefficient. Only a small fraction of the fuel is burned in combustion, most of it goes out the tailpipe as an unburned pollutant. Also, most of the energy produced is waste heat. Pulling electrons directly off the atoms as they react uses almost all of the fuel, and since the energy is being converted directly into electricity, the energy can be stored in a battery, instead of being dissipated as waste heat, or pushed out the tailpipe as unburned fuel. The most popular method of producing hydrogen fuel is electrolysis of water.
Any coastal city is well positioned to collect the raw material.
The energy used to power the electrolysis is generally solar power. So, if we are willing to buy alternate fuel cares, and pump hydrogen at the service station, we could worry a lot less about Middle East politics and ground pollution in our cities.