How did we figure out all of these molecules, their shapes, and properties in the first place? While there are many different techniques one of the most powerful is mass spectrometry.
A mass spectrometer measures the mass to charge ratio (m/z) of a molecule or fragments of a molecule in order to determine their identity. To do this the molecule is bombarded with electrons causing it to become charged and in some cases fragment. The newly charged molecule and fragments are then subjected to an electric or magnetic field that causes them to accelerate.
Since components with different m/z accelerate at different rates they will arrive at the detector at different times. This separation is plotted in a mass spectrogram then analyzed to determine the identity of a molecule.
A mass spectrogram consists of a series of peaks each of which represents a different molecule or molecule fragment.