(a) The change of a magnesium atom to a magnesium ion
We could represent this as half - reaction:
Mg has 2 electrons in its outer shell. To become an ion, it must lose those 2 electrons:
Mg => Mg+2 + 2e-
-------------------------------
(b) The change of a bromine atom to a bromide ion
Bromine has 7 electrons on its outer shell. It must gain 1 electron to become an ion
Br + 1e- => Br-