Finding the volume needed to make a new pH
$$\ce{NaOH + HCl -&gt; NaCl + H2O}$$

Let $x$ Litres be the amount of $\ce{NaOH}$ needed. 

$$-\log[\ce{H+}] = 2$$

$$-\log\left(\frac{(0.5 \times 0.02 - x \times 0.5)}{(0.02 + x)}\right) = 2$$

$$x = \frac{49}{2550}$$

$$x \approx 0.0192 \; \text{(3 sig. fig.)}$$

Thus, $\pu{0.0192 L}$ of $\ce{NaOH}$ is needed.