The vertical axis is the y-axis. To find the distance from a point to y-axis (coordinate x=0) you use the coordinate x in the point (x,y) in the next formula:
[tex]d=\lvert x\rvert[/tex]As the diatance is a positive quantity you get the distance from a absolute value.
For the given point:
Coordinate x = -2
[tex]d=\lvert-2\rvert=2[/tex]