Find the shortest distance between a point $(0, b)$ and the parabola $x^2=4y.$
My attempt: For a point $(x,y)$ on the parabola, the distance between a point $(x, y)$ on the parabola and given point $(0, b)$ is (by definition of distance formula) $$D^2=(x-0)^2+(y-b)^2.$$Since the point $(x, y)$ lies on the parabola, we have that $$D^2=4y+(y-b)^2.$$ Since $D$ is minimum implies that $D^2$ is also minimum. Therefore, I applied the first order necessary condition for minimum, i.e. $$\frac{dD^2}{dy}=0\implies y=b-2.$$Also, we have $\frac{d^2D^2}{dy^2}>0$ means that $D^2$ attains a minimum value at $y=b-2$ and the minimum value is square root of $4b-4.$
But what if $b<1$? Please help why this method is not working or at what point I am not focusing on?
The point you are missing is that for $b < 2$, we cannot have $y = b-2$, since $4y = x^2 \implies y\ge 0$.
Instead, notice that for $b<2$ (and $y\ge 0$):
$$\frac {d{D^2}}{dy} = 4+2(y-b)>4+2y-4\ge0$$
Hence $D^2$ is increasing as $y$ increases. This shows that the minimum is attained at $y=0$.