There are many ways to do this, I prefer the distance formula it looks like this:

We are given 2 pairs of coordinates: (0,2) and (0,4)
0=x1
2=y1
0=x2
4=y2
We take the numbers and sub in the values above in place of the variables:

Simplfy it:

0^2=0
2^2=4
We are left with :

Final answer: 2