Calculating the volume of 2 M solution needed to make a 0.1 M solution
If you have a simple solution of say $\pu{0.1 M}$ sodium chloride, you have $\pu{0.1M}\, \ce{NaCl}$ in $\pu{100 ml}$.
Which is equivalent to &quot;$\pu{100 mL}$ of $\pu{0.1 mol}\,\ce{NaCl}$ per litre&quot;, or,
$$n_\ce{NaCl} =\frac{100}{1000} \times 0.1 = \pu{0.01 mol}$$
$\pu{5 mL}$ of $\pu{2 M}\ \ce{NaCl}$ is equivalent to &quot;$\pu{5 mL}$ of $\pu{2 mol}$ $\ce{NaCl}$ per litre&quot;, or,
$$n_\ce{NaCl} = \frac{5}{1000} \times 2 = \pu{0.01 mol}$$
So congratulations, you did it right. If ever you aren't sure, just write out all the steps and follow it through.
You could also look at it like this - $\pu{2 M}$ is $20\times$ more concentrated than $0.1\times\frac{2}{0.1}$, so you expect to need $20\times$ less of the $\pu{2 M}$ than the $\pu{0.1 M}$.
$\pu{5 ml}$ is $20\times$ less than $\pu{100 mL}$.