Electrons can gain the energy it needs by absorbing light. If the electron jumps from the second energy level down to the first energy level, it must give off some energy by emitting light. The atom absorbs or emits light in discrete packets called photons, and each photon has a definite energy.
Atomic electrons lose / gain energy when transferring from one orbital to another and hence emitting / absorbing a photon. Free electrons (by which I mean electrons that are not part of an atom) lose or gain energy by scattering inelastic ally with atoms or molecules. In this case, energy is transferred to / from the atom or molecule from / to the electron in the form of kinetic energy
Once you have identified the limiting reactant, you calculate how much of the other reactant it must have reacted with and subtract from the original amount.