Hydrogen and oxygen can be separated through electrolysis. An electrical current is passed through water and separates water atoms into its hydrogen and oxygen parts.
In electrolysis, an electrode is passed through water. One end of the electrode becomes positively charged (anode), while the other is negatively charged (cathode). Hydrogen becomes attracted to the cathode, while oxygen becomes attracted to the anode.
Replicate this experiment easily by using a 9-volt battery, two pieces of metal wire and two pencils. Sharpen both ends of the pencil and, using the wire, connect each pencil to one end of the battery. Place the other end of the pencils into the water. Hydrogen and oxygen will gather at each end. Salt can be added to increase the conductivity of the water.