There are a handful of ways to produce hydrogen fuel without emitting carbon into Earth's atmosphere. One involves using electricity to split water into hydrogen and oxygen.
source https://www.lifetechnology.com/blogs/life-technology-technology-news/new-electrocatalyst-offers-hope-for-less-expensive-hydrogen-fuel