There are two possible sources for the hydrogen:
Electrolysis of water - Using electricity, it is easy to split water molecules to create pure hydrogen and oxygen. One big advantage of this process is that you can do it anywhere. For example, you could have a box in your garage producing hydrogen from tap water, and you could fuel your car with that hydrogen.
Reforming fossil fuels - Oil and natural gas contain hydrocarbons -- molecules consisting of hydrogen and carbon. Using a device called a fuel processor or a reformer, you can split the hydrogen off the carbon in a hydrocarbon relatively easily and then use the hydrogen. You discard the leftover carbon to the atmosphere as carbon dioxide.