Place inert electrodes (ones that wont react) into an aqueous solution.
At the positive electrode the negatively charged ion from the compound will form an atom. At the negative electrode the atom of the positive ion will form.
sodium chloride: Hydrogen at the negative; chlorine at the positive
copper(II) sulfate: copper at the negative; oxygen at the positive
dilute sulfuric acid: Hydrogen at the negative; oxygen at the positive
If the metal in the solution is more reactive then hydrogen, the hydrogen from the water will be a product, as the metal will bond with the oxygen.
Test the products using known methods: eg damp blue litmus paper turned red by chlorine.