The first thing to do when trying to write an atom's electron configuration is to figure you exactly how many electrons must be accounted for.
To do that, grab a periodic table and look for that atom's atomic number.
In your case, beryllium,
Therefore, your electron configuration must account for
#"Be: " 1s^2 2s^2#
In this case, the only option available is helium,
#"He: " color(blue)(1s^2)#
Notice that the configuration that accounts for the first two electrons is identical for both atoms. This means that you can replace it in beryllium's configuration to get
#"Be: " color(blue)(1s^2) 2s^2#
The electron configuration of helium is written like this,
#"Be: " ["He"] 2s^2#