Oxygen gains two electrons when it bonds to form a complete outer shell and magnesium loses two electrons when bonding to gain its full outer shell.
As electrons are negative, the oxygen (which gains electrons) will become negative and the magnesium (which loses electrons) will become positive.
The negative and positive ions will then attract to one another due to the magnetic pull of the positive and negative.
Thats a tuff one ummmmmm 4.5 m
Answer:

Explanation:
We know we will need a balanced chemical equation with masses and molar masses, so, let's gather all the information in one place.
You don't tell us what the reaction is, but we can solve the problem so long as we balance the OH.
M_r: 58.32
Mg(OH)₂ + … ⟶ … + 2HOH
m/g: 58.3
(a) Moles of Mg(OH)₂

(b) Moles of H₂O
The molar ratio is 2 mol H₂O = 1 mol Mg(OH)₂.

The reaction will form
of water.
The molecular formula =C₆H₁₂O₆
<h3>Further explanation</h3>
Given
6.00 g of a certain compound X
The molecular molar mass of 180. g/mol
CO₂=8.8 g
H₂O=3.6 g
Required
The molecular formula
Solution
mass C in CO₂ :
= 1.12/44 x 8.8
= 2.4 g
mass H in H₂O :
= 2.1/18 x 3.6
= 0.4 g
Mass O in compound :
= 6-(2.4+0.4)
= 3.2 g
Mol ratio C : H : O
= 2.4/12 : 0.4/1 : 3.2/16
= 0.2 : 0.4 : 0.2
= 1 : 2 : 1
The empirical formula : CH₂O
(CH₂O)n=180 g/mol
(12+2+16)n=180
(30)n=180
n=6
(CH₂O)₆=C₆H₁₂O₆