Edited to try to clarify OP's confusion:
The distance between $(x,y)$ and $(0,5)$ is indeed $\sqrt{x^2+(y-5)^2}$.
The distance between $(x,y)$ and the line $y=0$ is $|y|$ (if $y>0$, then it is above the $X$-axis, and the distance is just the $y$ coordinate; if $y<0$, then the distance is $-y = |y|$). So the points on the parabola are exactly the points for which the two distances are equal, that is, all $(x,y)$ for which:
$$\sqrt{x^2+(y-5)^2} = |y|.$$
Now square both sides, and you'll get the equation of the parabola you want.
How is this related to the formula you quote? It's really all just the same process. If the directrix is either horizontal (a line of the form $y=k$) or vertical (a line of the form $x=\ell$), then it is very easy to compute the distance from a point to the directrix: the point $(x,y)$ is $|y-k|$ away from the line $y=k$, and is $|x-\ell|$ away from the line $x=\ell$. If the focus of the parabola is at $(a,b)$, then you want the distance from $(x,y)$ to $(a,b)$ to equal the distance to the directrix, so you get:
\begin{align*}
\sqrt{(x-a)^2 + (y-b)^2} &= |y-k| &\qquad&\mbox{if the directrix is $y=k$,}\\
\sqrt{(x-a)^2 + (y-b)^2} &= |x-\ell| &&\mbox{if the directrix is $x=\ell$.}
\end{align*}
Then squaring both sides yields the equation of the parabola. Doing it correctly will cancel out the $y^2$ term when the directrix is horizontal, and the $x^2$ term when the directrix is vertical.
For more general parabolas, when the directrix is neither horizontal nor vertical but an arbitrary line $y=mx+b$, you need to work a bit harder, because the distance from $y=mx+b$ to $(x,y)$ is not so simple to compute. Not too hard, but not as simple. Once you have a formula for the distance, you set it equal to the distance to the focus, square both sides, and get the equation of the parabola.
(Sketch.) Let $P$ and $Q$ be two points on a parabola, and let $R$ be the point where the respective tangents to the parabola intersect. Let $X$ the midpoint of $PQ$. Then $RX$ is parallel to the axis of symmetry of the parabola (proved below). Draw lines through $P$ and $Q$ parallel to $RX$, and reflect these lines in the respective tangents; the focus $F$ is the intersection of the reflected lines.
To show that $RX$ is parallel to the axis of symmetry: Drop perpendiculars from $P,Q,R$ to the directrix, meeting it at $P',Q',R'$ respectively. As you alluded to, the tangent at $P$ is the perpendicular bisector of the segment $FP'$, and likewise for $Q$ and $FQ'$. So, in $\triangle FP'Q'$, two of the perpendicular bisectors pass through $R$; therefore the third does as well. Since $RR'$ is a line through $R$ and perpendicular to $P'Q'$, it must be the perpendicular bisector, that is, $R'$ is the midpoint of $P'Q'$. By parallels, (the extension of) $RR'$ bisects $PQ$, that is, $RR'$ passes through $X$. So $RX$ is perpendicular to the directrix, as claimed.
Edit: Just for reference, here's what this looks like analytically: The direction of $RX$ is $(2,1)$; reflecting in $RP$ just means exchanging $x$ and $y$ coordinates, so the direction of $PF$ is $(1,2)$, and the line through $P$ in that direction is $2x-y=1$. Reflecting in $RQ$ means negating the $y$-coordinate, so the direction of $QF$ is $(2,-1)$, and the line through $Q$ in that direction is $x+2y=1$. The intersection of these lines is $(\frac35,\frac15)$.
Best Answer
Let's use the following form for the parabola:
$$y=a(x-h)^2+k$$
Distance from vertex $(h,k)$ to your directrix and focus is calculated using the following formula where $p$ is the distance.
$$a=\frac{1}{4p}$$
If $a$ is positive, the equation for your directrix will be as follows:
$$y=k-p$$
Also, the coordinates of the focus will be the following with $+a$:
$$(h,k+p)$$
If $a$ is negative, there are simply a few sign changes. Directrix equation with $-a$:
$$y=k+p$$
Focus with $-a$:
$$(h, k-p)$$
Hopefully this helped.