Y= mx +c ( y is a function of x and some constant)
According to theory , all y should obey the function formula so if we plot all y then we will get a straight line . But in practical, we always get Y which are slightly deviated from what their values are supposed to be. So if we plot then instead of getting all values of y on a straight line we are getting scattered y points nearby a straight line but not exact on straight line. so our goal is how can we fit the all y near to a straight line means how we can minimize the difference between actual y value( after observation) and corresponding y value of the fitted straight line.
That is the main reason to find out SSE which is minimum .( considering different m value of an equation).
Hope it helps you.