Here's why:
* Sodium (Na) is a metal and tends to lose one electron to become a positively charged ion (Na+).
* Fluorine (F) is a nonmetal and tends to gain one electron to become a negatively charged ion (F-).
The strong electrostatic attraction between these oppositely charged ions is what forms the ionic bond in NaF.