An atom can be excited either by
a collision with another particle (an electron, atom, molecule, etc.)
absorption of a photon exactly matching the energy difference between two states.