Here is electrolysis in a nutshell:
Electrolysis means 'breaking down by electricity'. It is the process in which you supply an electric current through two electrodes-these are just two carbon 'rods' (made of graphite specifically as it has a high melting and boiling point and doesn't react as much as other substances do. However, the positive electrode reacts with oxygen molecules formed to form CO2 in some electrolysis reactions, so has to be replaced from time to time). Electrolysis only works on ionic substances! This is because the two electrodes have opposite charges, and ionic substances are the only substances to have positive and negative ions, unlike covalent substances. Furthermore, electrolysis only works when the ionic substances are either molten (melted) or dissolved in solution. It's crucial you remember this as it is because when they are solid, their ions are only able to vibrate about a fixed point; they cannot move. However, when molten or in solution- the ions are free to move. This means, that when electrolysis takes place, the ionic compound will be broken down into its positive and negative ions. The positive ions are attracted to the negative electrode (called the cathode) and the negative ions are attracted to the positive electrode (caled the anode)
electrolysis is a highly useful process as it allows us to do many things. Aluminium for example is a highly useful metal, however is so reactive that we only find it in its ore: aluminium oxide. This is because it reacts as soon as it's exposed to the oxygen in our air. Aluminiums main ore is called bauxite. However, bauxite has a very high melting and boiling point so electrolysis would be very expensive as a lot of energy would be needed to melt bauxite. As a result, we dissolve aluminium oxide in another molten ore of aluminium called cryolite. This MASSIVELY reduces the boiling point and makes extraction of aluminium a much cheaper process.
Another thing you should know about it a process called electroplating. This is when we coat a cheaper metal, take brass, with a much more expensive metal, take gold
this is how you get things like gold coated watches for example. In electroplating, we make the thing we want to plate our negative electrode (take a brass watch). Then we make the substance in which we want to coat the object our positive electrode (take, gold). We also make sure the electrolyte (molten solution in the electrolysis cell) contains ions of the plating metal- here gold. At the negative electrode (brass watch) metal ions (gold ions) gain electrons to form the metal ATOMS which are deposited on the object (gold ions gain electrons and form gold atoms, which deposited onto the watch plate/ coat it)
I hope this post was useful as it took me a while to write, if you need anything PM me at anytime!