this is someone else’s answer but it answers your question
Molarity is defined as the number of moles of solute dissolved in 1 L of solution.
KNO₃ - 2.0 M this means that 2.0 moles of KNO₃ are in 1 L of solution.
If 1 L contains - 2.0 moles
then 0.50 L contains - 2 mol/L x 0.50 L = 1 mol
Therefore 1 mol of KNO₃ is in 0.50 L solution.