An electron configuration is a description of the relative locations of electrons in an atom or ion. Electron configurations are based primarily on three principles: the Aufbau principle, the Pauli exclusion principle, and the Heisenberg uncertainty principle. The most important thing to remember is that electrons fill orbitals from lowest energy to highest energy. Think about a hotel with many floors and a broken elevator; getting to the highest floor takes energy — lots of energy. Electrons conserve energy so that the lowest-energy level orbitals fill first.
You can use the following diagram, which is sometimes referred to as the diagonal rule, as an aid when writing electron configurations. Notice that putting an electron in a 3d orbital takes more energy than putting one in a 4s orbital, because 3d orbitals are more complex. There are other ways to remember the order in which orbitals fill — you can memorize the sequence or use a periodic table.
You may have to write an electron configuration for an ion instead of an atom. If you need to write a configuration for a cation (positive ion), remember to subtract the number of electrons equal to the charge from the total number of electrons before starting. Likewise, if you’re writing a configuration for an anion (negative ion), remember to add the number of electrons equal to the charge to the total number of electrons before starting.
Electron configurations only get more difficult as you choose elements with higher numbers of electrons. You can generally check your work by adding up all the superscripts to make sure that you have the right number of electrons. But note that some elements are exceptions to the diagonal rule. Your instructor or book should mention these elements and let you know if you’re responsible for knowing how to write their configurations.