The formula to find the distance between two points A and B is
[tex]\begin{gathered} d=\sqrt[]{(x_2-x_1_{})^2+(y_2-y_1)^2} \\ \text{ Where} \\ A(x_1,y_1) \\ B(x_2,y_2) \end{gathered}[/tex]So, in this case, you have
[tex]\begin{gathered} A(x_1,y_1)=(-2,1) \\ B(x_2,y_2)=(-5,4) \end{gathered}[/tex][tex]\begin{gathered} d=\sqrt[]{(x_2-x_1)^2+(y_2-y_1)^2} \\ d=\sqrt[]{(-5-(-2))^2+(4-1)^2} \\ d=\sqrt[]{(-5+2)^2+(4-1)^2} \\ d=\sqrt[]{(-3)^2+(3)^2} \\ d=\sqrt[]{9+9} \\ d=\sqrt[]{18} \\ d=4.2 \end{gathered}[/tex]Therefore, the length of the segment with endpoints at (-2,1) and (-5,4) is 4.2 units.