1L of 0.5M HCl contains 0.5mol of HCl which can react.
This can be found by the fact that
molarity is defined as the number of moles of a substance per Liter of solution. That means that 0.5M of HCl can be thought of as 0.5moles of HCl per liter of solution.
In general to find the number of moles of substance in a solution using the molarity all you do is multiply the molarity by the volume of the solution (in liters).
I hope this helps. Let me know if anything is unclear.