It takes energy to produce hydrogen. Where you procure that energy determines how “clean” it is. If you get your energy from nukes then it’s pretty clean, if you burn natural gas to get the energy then you’re still emitting carbon dioxide to produce the hydrogen, just at a different place.
Hydrogen is a byproduct of nuclear fusion.