When light passes through a vapour of an element (or a gas, such as helium), some of the light is absorbed. The absorbtion happens at specific wavelengths, i.e. the absorbtion spectrum is a continuous spectrum with gaps in it. These gaps are always the same for a given element.
We can also get a sample of an element to give out light by heating it or passing an electric current through it in a discharge tube. The light they give out does not form a continuous spectrum. Instead, there are discrete lines in the spectrum. Each line corresponds to the release of a quantum of energy from the atom.
This suggests that atoms must have excited states. They can absorb energy to push them up to an excited state (in which they have more internal energy). They then release energy (often as light) when their internal energy drops.
A system whose internal energy can change must be made up of two or more particles with a force between them. This leads us to the conclusion that atoms must be made up of other, simpler particles. They are not fundamental.