Answer:-
Carbon cannot reduce sodium, magnesium and calcium to their respective metals because carbon is lower than them in the electrochemical series.
Only metals higher in the electrochemical series can displace metals placed lower.
Sodium, magnesium and calcium are obtained from their salts by electrolysis of the salts.
Sodium Chloride is the sodium salt used. Sodium is deposited at cathode.
Chlorine gas is produced from the process.
Cathode: 2Na+ + 2e- --> 2Na (Reduction)
Anode: 2Cl- --> Cl2 + 2e- (Oxidation)
Potassium and Calcium are two other metals that can be extracted by the same method