I'm trying to find the equation of a line starting at $(x_1, y_1)$ to $(x_2, y_2)$. So I took a point on the line $(x_1, y_1)$ and put it into a system of equation. Now what is the method to find the value of $y$ with respect to the other terms?
$\begin{cases} y_2=mx_2+p \\ y_1 = mx_1 + p \end{cases}$
And what I want is $y = ...$
You want both $y_1=mx_1+p$ and $y_2=mx_2+p$. Solve these equations to find $m$ and $p$. Subtracting we get $y_1-y_2=m(x_1-x_2)$ so $m =\frac {y_1-y_2} {x_1-x_2}$. I will let you find $p$.