An element has only One type of atom.
A compound is when two or more elements get chemically combined.
(Mg + O2 = MgO)
(Magnesium + oxygen = Magnesium oxide)
When we have water we can freeze water so it turns into a solid. We can undo that so the solid can melt back into a liquid.
With our experiment we can't turn magnesium oxide back into the separate elements we started with: Mg and O2.