Remember that the equation of a straight line (when given two points OR a point and a gradient) is y-y_1 = m(x-x_1) where m is the gradient and (x_1,y_1) is a point on the line.
Since we have two points, we must find the gradient between them. We can do this using m=(y_1-y_2)/(x_1-x_2). From the two points in the question, we get m=(2-4)/(1-2). This gives m=2.
Now we can use this gradient with either point from the question to give the equation of our line.
So, y-2=2(x-1) and we can rearrange this to get y=2x.