Beryllium has an atomic number of 4 and an atomic mass of 9. Each atom consists of neutrons, protons and electrons. The number of each of these sub-atomic particles can be calculated by knowing the atomic number and atomic mass of the element. Each atom contains an equal number of protons and electrons, thus providing it with a neutral charge. The mass of an atom is contributed by masses of protons and neutrons, electrons are considered comparatively massless.
Thus, atomic number = number of protons = number of electrons
And, atomic mass = number of protons + number of neutrons
Here, the atomic number is 4, thus beryllium contains 4 electrons and 4 protons. Since, the atomic mass is 9, the number of neutrons is equal to 5 (= 9 - 4).
Hope this helps.