A linear function can be written in slope-intercept form, which is
Where m represents the slope and b represents the y-intercept.
We have two points that satisfies this equation. (-2, 6) and (4, -4). If we evaluate both points on the slope-intercept form we're going to create a linear system where the solutions are the values for the slope and y-intercept.
If we subtract the first equation from the second, we're going to have a new equation only for the slope.
Using this value for the slope on any of the previous equations, we can determinate the other coefficient
Now that we have both coefficients, we can write our line equation.