Hello, Niama,
First, determine the number of moles in 5 grams of Mg by dividing by it's molar mass (24.4). I get 0.205 moles Mg. The balanced equation promises us that it will deliver the same number of moles of MgCl2. To find grams MgCl2, multiply by it's molar mass (95.2) to yield grams MgCl2.
I hope this helps,
Bob