Does beryllium want to gain or lose electrons? I know it has 4 protons, 2 valence electrons, and it will gain or lose 2 electrons, but what is it?
Look at the column it's in on the Periodic Table of the Elements. It's above Magnesium.
Look at where in the row it's in. There are six elements to the right of it in that row. It would have to gain six electrons to fill up the valence shell, or lose two to vacate the shell.
There's more than just those two things to consider, but that answers the question most of the time.
And, even though many teachers fall into this trap, be careful with saying "want" in terms of gaining / losing electrons. It is more stable for Beryllium to lose two electrons than it is for it to gain six.