how the halides and oxides of top of the activity series metals are extracted
Answers

Metals can be categorized on the basis of their reactivity as most reactive, medium reactive, and least reactive.
Metals which are at the top of the reactivity series are very reactive so they are never found in free-state. For example, K, Ca, Na, Al and Mg.
These metals have more affinity for oxygen. It is not possible to obtain them from their compounds by heating with carbon. So electrolytic reduction is used to obtain these metals. The cathode supplies electrons to metal ions for their reduction to the metal during electrolysis.
For example, Sodium metal is obtained by the electrolysis of molten sodium chloride. Sodium ions migrate to the cathode where the electrons enter the melt and are reduced to sodium metal. Chlorine ions migrate to the anode where they give up their electrons. They are oxidized to chlorine gas.