White light is photons of all kinds of energy levels.
Electrons orbitting a nucleus (outdated model, but sufficient for this case) can have only certain energy levels, for instance 5 and 9, but not 6, 7 or 8.
An electron can only absorb a photon when the energy of the photon is the exact amount it needs to get to a higher energy level.
Now suppose we shine white light (for simplicity: photons with energy 2 (red) and 4 (blue) ) on our atom. It will absorb only the 4 photons, so it will apear red.
Latest Answers