In order to write ground state electron configuration you will use the Aufbau principle and the diagonal diagram.
It is important to know how many electrons can be held in the different sublevels*.
s = 2
p = 6
d = 10
f = 14
*These are maximum values and the last sublevel will not always be completely full.
Here is a video which will walk you through the process of writing electron configurations.
Hope this helps!