Aluminium is more reactive than carbon, and therefore has to be extracted from its ore, bauxite, by electrolysis. Bauxite, pure aluminium oxide, Al2O3, has a very high melting point. The ore is dissolved in molten cryolite to bring the melting point down to a more manageable, and less expensive level. The electodes are made of carbon. The anode needs replacing quite often, as it keeps reacting to form carbon dioxide.
     Cathode                       Anode
     |     |                      |     |
     |     |                      |     |
-----|     |----------------------|     |---------
     |     |                      |     |
     |     |                      |     |
     |     |                      |     |
     |-----|                      |-----|

                   Molten cryolite          
                  
    /--------------------------------------------
   /        Aluminium metal
  /  /-------------------------------------------
 /  /
/  /

When the ore is molten, the ions are released and free to move. The cations, which are positive, head straight for the cathode, where they pick up extra electrons and turn into aluminium atoms. They sink to the bottom and are piped off.

Reaction at the cathode - Al3+ + 3e- -> Al (reduction reaction).
Reaction at the anode - 2O2- -> O2 + 4e- (oxidation reaction).