We have a straight line AB.
Take a point P not on AB, but some distance away. We draw PC the perpendicular on to AB meeting AB at C. We draw another line from P to D, where D lies on AB. We show that PD > PC, for any point D other than C.
In the triangle PCD, use the Pythagorean law for sides:
PC² + CD² = DP²
Since CD² is positive and adds to PC², PC²+CD² > PC²
Hence DP² > PC²
So DP > PC
SO PC, the perpendicular distance from an external point to a line segment, is the shortest.