Molarity can be defined as the number of moles dissolved in 1 L of solution.
The molarity of MgCl₂ is 0.38 mol/L
In 1 L of MgCl₂ solution, amount go 0.38 moles is dissolved.
Therefore in 1.31 L of MgCl₂ - 0.38 mol /1 L x 1.31 L = 0.4978 mol rounded off is 0.50 mol
In 1.31 L of solution, amount of 0.50 mol of MgCl₂ is present.