Hey there!
When we want to consider the smallest distance from a point on a curve from a fixed point (a, 0), we consider a moving point on the curve such that the tangent to the curve at the moving point is perpendicular to the line from the moving point to the fixed point (a, 0).
In this case, since you've got that 0<p<a, we can restrict our function to \(y = \pm \sqrt{2px}\). Something also important to note is the parametric form of our moving point, which in this case will be \((pt^2, \sqrt{2}pt)\). Note that when we minimise the distance from the parabola to the fixed point, we can have positive y and negative y for the same x-value - we can thus restrict our function to \(y = \sqrt{2px}\), consider the positive case then have the points \((pt^2, \pm \sqrt{2}pt)\) satisfy the condition.
Now, the tangent to the curve at the moving point has gradient \(\frac{\sqrt{2p}}{2\sqrt{x}} = \frac{\sqrt{2p}}{2\sqrt{pt^2}} = \frac{1}{\sqrt{2}t}\). The gradient of the line between the fixed point and the moving point is \(\frac{y_2-y_1}{x_2-x_1} = \frac{\sqrt{2}pt}{pt^2-a}\).
Now, we want these to be perpendicular to minimise the distance ie. \(\frac{\sqrt{2}pt}{pt^2-a} \times \frac{1}{\sqrt{2}t} = -1\).
Hopefully it's evident that we have \(p = a - pt^2 \implies p(1+t^2) = a \implies t = \sqrt{\frac{a}{p}-1}\). Substituting this value of t into \((pt^2, \pm \sqrt{2}pt)\) will give us the points on the curve that satisfy this condition.
Hope this helps