Answer
$y=-x+3$
$d=6\sqrt2.$
$M=(1,2)$.
Work Step by Step
We know that by the Slope Formula: if $P_1(x_1,y_1)$ and $P_2(x_2,y_2)$ are on a line, then the slope is: $m=\frac{y_2-y_1}{x_2-x_1}$.
Hence here: $m=\frac{5-(-1)}{-2-4}=-1.$
We know that if the slope of a line is $m$ and it contains $P_1(x_1,y_1)$, then its equation is: $y-y_1=m(x-x_1).$
Hence here: $y-(-1)=-1(x-4)\\y+1=-x+4\\y=-x+3$
The distance formula from $P_1(x_1,y_1)$ to $P_2(x_2,y_2)$ is $d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$.
The midpoint $M$ of the line segment from $P_1(x_1,y_1)$ to $P_2(x_2,y_2)$ is: $(\frac{x_1+x_2}{2},\frac{y_1+y_2}{2})$.
Hence: $d=\sqrt{(-2-4)^2+(5-(-1))^2}=\sqrt{36+36}=\sqrt{72}=6\sqrt2.$
$M=(\frac{4+(-2),\frac{(-1+5)}{2}}{2})=(1,2)$.