$\underset{\text{2$\times$24}}{ {2Mg}}$+$\underset{\text{2$\times$16}}{ {O2}}$$ {->}$$\underset{\text{2(24+16)}}{ {2MgO}}$
$48\,g$ of $Mg$ requires $32\,g$ of $O_{2}$
$1\, g$ of $Mg$ requires $\frac{32}{48} = 0.66\,g$ of $O_{2}$
Oxygen available $= 0.5\, g$
Hence, $O_{2}$ is limiting reagent,
$ 32 \,g$ of $O_ {2}$ reacts with $48 \,g$ of $Mg$
$0.5\, g$ of $O_{2}$ will react with $\frac{48}{32} \times 0.5 = 0.75\,g$ of $Mg$
Excess of $Mg = (1.0-0.75) = 0.25\,g$