Think of the formula unit as an "ionic molecule".
Ionic compounds are formed when positively charged ions, or cations, and negatively charged ions, or anions, are bonded together by the electrostatic force of attraction and held in giant lattice structures.
Since the cations and anions are stuck together in this giant structure, you can't say that you're dealing with molecules.
Instead you get formula units. A formula unit is the smallest whole number ratio that exists between the cations and anions that form an ionic compound.
For example, sodium chloride,
These ions come together to form a lattice structure that looks like this
As you can see, the ions are distributed in a
Each unit cell contains an equal number of sodium cations and an equal number of chloride anions.
This means that the formula unit of sodium chloride, i.e. the empirical formula that best describes this ionic compound, is