This is taken from Hansen's econometrics textbook.
Take the linear model:
$$Y = Z\beta + e $$
Let the residuals in an IV regression be $\tilde e$ and in an OLS regression $\hat e$. If X is indeed endogeneous, will IV fit better than OLS in the sense that $\tilde e' \tilde e$ < $\hat e' \hat e$?