5-(1) Y2-Y1 over 4-2 X2-X1. 4 over 2 which simplifies to a positive 2 for Slope. now you use point slope to find your actual equation
Y-Y1=M(X-X1)
Y-(-1)=2(X-2)
you will get a positive 1 on the left side of the equation
distribute 2 in with X and -2
you should have Y+1=2X-4
subtract 1 from the left to the right and get
Y=2X-5
that is your equation passing through (2,-1) and (4,5)