Hydrogen can be produced from different sources like nuclear power, biomass, natural gas through hydrogen fuel cell technology.
It's operation is almost similar to electric vehicle (ev) wherein H2 vehicles produce electricity within the car to power the vehicle motor while ev needs external source of power.