In order to keep track of which orbitals electrons are placed in, a variety of approaches have been used. One of the more useful in terms of predicting bonding and seeing why certain chemical behaviors are common to groups of elements is electron configurations. And....it can be connected to the periodic table--a handy and ready reference!
In writing the electron configuration for an element, you begin at the beginning, recalling that each atom contains within it the electron structure for all preceding atoms in the periodic table. Each electron structure is therefore "built up" from the previous ones in a regular manner. This is sometimes called the Aufbau Principle.
In some texts p orbitals and d orbitals are "spelled out" in more detail. We don't need to worry about that as long as we keep in mind how the electrons are "filling" into these orbital sets. One electron is placed into each orbital before pairing begins. This minimizes repulsions.