To answer this question, it could be useful to go back to the definition of molarity. Molarity, as a unit of concentration, is the ratio of the amount of moles of solute contained in 1 L of solution.
In general, the equation that relates molarity, moles, and volume of solution, is
C = n / V
where C is the concentration of the solution in molar, n is the number of moles dissolved in the solution, and V is the volume of the solution.
For this question, we can plug in the knowns and solve.
(0.40 M) = n / (0.500 L)
Multiplying both sides by 0.5, gives
(0.40 M) * (0.500 L) = n
so,
n = 0.20 mol (note 2 sigfigs)