Answer : When you know the weight of crucible before weighing the magnesium in it suppose x g.
After weighing the required given of magnesium suppose a g. The weight of the crucible becomes ( x + a) g now. So, you know how much amount of magnesium you weighed before the synthesis and before heating.