The most common method of producing hydrogen is elecrolysis, where hydrogen can be extracted from water directly, by simply adding electricity. The diagram below shows how electrolysis works.
When electricity is applied to water, the oxygen atoms are attracted to the anode, and the hydrogen atoms are attracted to the cathode. This splits up the water molecules, and the two gases bubble up into the air. The hydrogen can then be captured.