An atom can gain energy by absorbing a photon. Later, it can give up that energy by emitting a photon. (Animation inspired by Quantum Made Simple)
Credit: Emily Edwards/The Quantum Atlas (CC BY-NC-SA 4.0)