Magnesium belongs to the group 2, i.e., the family of alkaline earth metals in the periodic table. It has 2 valence electrons and thus is highly reactive.
Being very reactive, it readily reacts with the gases present in the air. Thus, impurities form a layer on the surface of the ribbon.
While using magnesium ribbon in the lab, it is first cleaned using a sand paper. The sand paper is rubbed against the magnesium ribbon. This helps in removing the impurities and hence cleans the magnesium ribbon. It might give improper results if cleaning is not done, it may sometimes do not show any reaction if heavy impurities are deposited on the ribbon. Thus, it is always suggested to clean the magnesium ribbon or strip before using.
I hope this answer helps. 😊