Most of the metals are obtained from molten metal chloride and metal oxide by electrolysis reaction.
For example:- 2NaCl=2Na+ Cl2
In the above example, molten sodium chloride is passed through electricity, it decomposes into sodium metal and chlorine gas.