Like electricity, hydrogen is an energy carrier, not an energy source. Hydrogen burns with oxygen to produce water and heat. The heat can do the same sorts of useful work that the hydrocarbons do, without the carbon. Our biggest rockets were powered by engines that burned liquid hydrogen and oxygen. And using fuel cell technologies, hydrogen and oxygen (which can come from the air, I think) can produce electricity.
Unfortunately, there’s no cheap, easy way to make the hydrogen. Currently, we crack natural gas to make hydrogen gas. As with natural gas, storage requires pressurized tanks and/or cooling to the point the gas becomes a liquid. The holy grail of hydrogen production is a cheap, feasible process to use energy from the sun or the wind to crack water into hydrogen and oxygen.