to get the equation of any straight line, all we need is two points from it, let's use those ones in the picture below, (4 , 2) and (8 , 4)
[tex](\stackrel{x_1}{4}~,~\stackrel{y_1}{2})\qquad (\stackrel{x_2}{8}~,~\stackrel{y_2}{4}) ~\hfill \stackrel{slope}{m}\implies \cfrac{\stackrel{rise} {\stackrel{y_2}{4}-\stackrel{y1}{2}}}{\underset{run} {\underset{x_2}{8}-\underset{x_1}{4}}}\implies \cfrac{2}{4}\implies \cfrac{1}{2}[/tex]
[tex]\begin{array}{|c|ll} \cline{1-1} \textit{point-slope form}\\ \cline{1-1} \\ y-y_1=m(x-x_1) \\\\ \cline{1-1} \end{array}\implies y-\stackrel{y_1}{2}=\stackrel{m}{\cfrac{1}{2}}(x-\stackrel{x_1}{4}) \\\\\\ y-2=\cfrac{1}{2}x-2\implies y = \cfrac{1}{2}x[/tex]