The smallest identifiable unit into which a pure substance may be divided while retaining its composition and chemical properties is a molecule, which is a collection of two or more atoms.
Molecules of elements
A molecule is a collection of two or more chemically bound atoms, whether they are from the same element or another.
For example, when two hydrogen (H2) and one oxygen (O2) atoms interact, one water molecule is created.
Molecules of compounds
Salts and molecular compounds are the two categories into which compounds can be divided. Covalent bonds hold the atoms together in molecular molecules. Ionic bonds hold it together in salts. Every compound is composed of one of these two types of bonds.
Actually, a compound is a kind of molecule. The atoms that join together must be distinct from one another for the substance to qualify as a compound. O2, for instance, is a molecule, not a compound. Due to its atomic connection with another oxygen atom. NaCl, however, is a compound since it is made up of two distinct atoms that are chemically bound together.