If you know the coordinates of two points
[tex] P = (P_x, P_y),\quad Q = (Q_x, Q_y) [/tex]
of two points, the slope of the line passing through them is given by
[tex] \dfrac{P_y-Q_y}{P_x-Q_x} [/tex]
So, if we choose in this example
[tex] P = (1,4),\quad Q = (5,1) [/tex]
The slope is
[tex] \dfrac{4-1}{1-5} = \dfrac{3}{-4} = -\dfrac{3}{4} [/tex]