While writing a chemical formula,
Cation, Anion
The chemical formula is written with cation at first followed by anion with the suffix added in the last of anion naming Cl−, H− chloride, hydride respectively. For example - NaCl is called sodium chloride.