Here's why:
* Sodium is a metal in group 1 of the periodic table, and it forms a +1 ion (Na+).
* Bromine is a nonmetal in group 17 of the periodic table, and it forms a -1 ion (Br-).
To balance the charges, one sodium ion combines with one bromide ion, resulting in the formula NaBr.