Step 1 - Understanding what is a diatomic molecule
Diatomic can be divided in two words: di, which means "two", and atomic, which refers to atoms. Therefore, a diatomic molecule is a molecule that only contains two atoms. They may be different as well as the same atom.
Examples: HI, HCl, H2, N2, Cl2, and so on
Remember: a molecule only can be formed via covalent interactions. Ionic compounds, such as NaCl, KCl, NaOH, etc, are not molecules.