See the explanation.
You need to look at the entire equation. You are looking only at the reactants, sodium metal and chlorine gas.
The above equation is not balanced. The number of atoms of each element on the left and right of the equation must be the same.
Since the formula for chlorine gas is
So we see that two atoms of sodium plus one molecule of chlorine produces two atoms of sodium chloride. And, as you can see, the compound