# Can someone explain autocorrelation between observations in linear regression

I'm new to linear regression. I created a simple linear regression model (only one feature). I am checking my assumptions, and I am having difficulty with the Independence assumption. I don't really understand what effect correlated observations has on the model and its results. Can someone explain in layman's terms. I just don't really understand why it matters or why/how we even test for this assumption. I'm just trying to learn more. I know I asked a lot of questions already, but thank you in advance if anyone can help me.

When you apply linear regression ($$\hat{f}(x) = ax + b$$, where both $$a,b$$ are real values), you obtain an estimated value $$\hat{f}(x)$$ given the values $$x$$. But you also have the true data values (TDV) - these are the data points in your data set. The residuals (or the "noise") are the $$TDV - \hat{f}(x)$$.
Once you have your sequence of residuals ($$= TDV - \hat{f}(x)$$), you can can calculate the autocorrelation function for them. In most computer languages, you'll find a function that will do that for you. What you want to see for correlation is a value very close to zero. Visually, you shouldn't be able to spot patterns in the residuals' (again, vaguely) behavior. You don't want residuals with a clear trend (up or down), or with cycles, for instance. These clear patterns would mean the residuals are somehow correlated. It's also beneficial to say that you'll likely find some correlation among residuals, but you have to establish a threshold to define what is acceptable or not.