A formula unit is the simplest whole-number ratio of ions in an ionic compound, written as its chemical formula. Ionic compounds such as table salt do not form separate molecules; they form a continuous crystal lattice of alternating positive and negative ions, so chemists describe them by the smallest ratio of cations to anions instead of by a molecule.
For example, sodium chloride has one Na+ ion for every Cl- ion, so its formula unit is NaCl, while calcium chloride has two Cl- ions for every Ca2+ ion, so its formula unit is CaCl2. The formula unit is always electrically neutral, and chemists treat it as the counting unit for stoichiometry, much as they would use a molecule for a covalent compound.
Source: Chemistry LibreTexts: Formulas for Ionic Compounds
Image: Sodium chloride crystal lattice model, by Benjah-bmm27, public domain, via Wikimedia Commons.