>>11498456electrolysis
If you're bored and wanna do an in home experiment, simply drop a 9-volt battery in a glass of water with a spoonful of salt mixed in.
You'll see hydrogen bubbles form on 1 end and oxygen bubbles form on the other end. You could collect the bubbles with another container if you wish by putting it upside down in the water, make sure there's no air in it, then just place it over the battery it'll fill up with gas. You can collect the hydrogen from 1 side, oxygen from other, or collect both in 1 container.