Working with the metric
$$ds^2=\frac{dx^2+dy^2}{y^2}.$$
The idea is that you use this formula to calculate the length of a given path
$\gamma(t)=(x(t),y(t))$. As is the case with the Euclidean metric, the length of a path, $L=\int_\gamma \,ds$, connecting two points depends on the path.
For example, consider two paths connecting the points $(0,5)$, $(4,3)$.
Let $\gamma_1$ be the straight line $\gamma_1:x(t)=t, y(t)=5-t/2, 0\le t\le4$. Here $dx^2+dy^2=(5/4)dt^2$, so
$$
L_1=\int_{\gamma_1}\,ds=\int_{t=0}^4\frac{\sqrt5}{10-t}\,dt=\sqrt5\ln\frac53\approx 1.14224.
$$
If, instead, we consider the circular arc $\gamma_2:x=5\cos t, y=5\sin t$,
$\arcsin(3/5)\le t\le\pi/2$ we get $ds=5\,dt$, and
$$
L_2=\int_{\gamma_2}\,ds=\int_{t=\arcsin(3/5)}^{\pi/2}\frac{dt}{\sin t}=\ln 3\approx1.09681.
$$
Thus the circular path is shorter. The heuristic reason is that the circle spends less time closer to the $x$-axis, where $1/y$ grows rapidly.
It turns out that half circles perpendicular to the $x$-axes are geodesics for this metric. Undoubtedly you noticed that $\gamma_2$ is such a half circle. Therefore $L_2$ gives the shortest distance along any path connecting these two points.
Geodesics can (at least in principle) be found by solving the related calculus of variations problem of finding the path minimizing the integral. For metrics there are differential equations describing the geodesic paths (see the other WP article). Describing those and solving them for this metric is not my cup of coffee, so you need to wait for a better answer for that.