We don't often consider beryllium compounds or nitrides so this looks difficult on the surface.
But it is just an ionic compound so we need to consider the ions formed by each element, and then work out their ratio in the product.
Beryllium is a group 2 metal so loses 2 electrons to form Be2+ ion.
Nitrogen has 5 outer shell electrons so will gain 3 electrons to form a nitride ion N3- . (Nitrogen can form other ions such but nitride is the most common / stable. Additionally you wouldn't be expected to be able to predict the formula of other nitrogen ions)
Therefore the formula of the compound beryllium nitride is Be3N2.