Picture a glass of water at the scale of particles. It is crowded with tiny identical units, each one an oxygen atom with two hydrogen atoms attached: H2O. Each unit is a molecule. The atoms inside it are held by covalent bonds, which means they share electrons, and the whole unit moves, tumbles and bumps into its neighbors as one piece. When water boils, the molecules move apart from each other but each one stays whole, which is why steam is still H2O.
A molecular formula is a parts list for one molecule. CO2 means 1 carbon atom and 2 oxygen atoms, 3 atoms in all; C3H8 (propane) means 3 carbon and 8 hydrogen, 11 atoms. A molecule can contain just one element, like O2 or N2, or several, like H2O. When the elements are different, the molecule is also the smallest piece of a compound.
Not every substance comes in molecules. Table salt has the formula NaCl, but a salt crystal is a huge grid of Na+ and Cl− ions, each one touching six of the other kind. There is no separate NaCl unit you could pull out; the formula only gives the 1 : 1 ratio. Helium is the opposite edge case: it exists as single atoms that do not bond at all. A rough test: substances made only of nonmetals usually form molecules, while a metal joined to a nonmetal usually forms ions.
Think of it like this. Molecules behave like snap-together models that have already been built. Pour a box of them out and shake it (heat it): the models bounce around and spread apart, but each one stays in one piece. Only taking a model apart, which in chemistry is a reaction, gives you back the separate pieces.
Core idea. A molecule is a fixed group of atoms joined by shared electrons that moves and reacts as one unit; substances made of molecules, like water, keep those units whole when they melt or boil.