Metals can be extracted from their molten compounds by electrolysis. This method is used when the metal is too reactive to be extracted by reduction with carbon, or when the metal reacts with carbon. Electrolysis uses large amounts of energy, because energy is needed to melt the compounds and to produce the electric current, so it is expensive.
Aluminium is made by the electrolysis of a molten mixture of aluminium oxide and cryolite. Aluminium oxide has a very high melting point, so melting it on its own would use a huge amount of energy. Cryolite is mixed with it because the mixture has a lower melting point, which saves energy and money.
Aluminium ions move to the cathode and form aluminium. Oxide ions move to the carbon anode, where oxygen is produced. This oxygen reacts with the carbon of the anode to make carbon dioxide gas, so the anode slowly burns away. The positive electrode must therefore be continually replaced.