This excellent Tyler de Witt video addresses a common mistake around diatomic elements (H2, N2, O2, F2, Cl2, Br2, I2).

For example, if chlorine is in its elemental form (i.e. not bonded in a compound) the formula is Cl2, but when chlorine is bonded to sodium the formula of sodium chloride is NaCl.