What is the variance-covariance matrix of the OLS residual vector? For example, take the generalized regression model: y = X$\beta$ + $\varepsilon$, what would the variance-covariance matrix be for $\varepsilon$ hat?
 A: First and foremost, your model is typically referred to as "general" instead of "generalised". 
I show you the calculation for $\textrm{Var} ( \hat{\beta} )$ so that you can continue it for $\textrm{Var}(\hat{\epsilon}) = \textrm{Var} ( Y - X\hat{\beta})$.
The OLS estimator of your vector $\beta$ is
$\hat{\beta} = (X'X)^{-1} X'Y$,
provided that $X$ has full rank.
Its variance is obtained as follows.
$\textrm{Var} ( \hat{\beta} ) = [(X'X)^{-1} X'] \times \textrm{Var} ( Y ) \times  [(X'X)^{-1} X']' \qquad$ (if needed, see the 'Properties' section here).
Now, if it is assumed that $\textrm{Var} ( Y ) = \sigma^2 I$, where $I$ is the identity matrix, then the previous line gives
$\textrm{Var} ( \hat{\beta} ) = \sigma^{2} (X'X)^{-1}$.
More details are provided in, e.g., wikipedia.
A: See Wikipedia under Studentized residual#How to studentize for the variance of a single residual:
$$\mbox{var}(\widehat{\varepsilon}_i)=\sigma^2(1-h_{ii})$$
where $h_{ii}$ is the ith diagonal entry in the hat matrix $H=X(X^T X)^{-1}X^T$.
And Hat matrix#Uncorrelated errors for the variance-covariance matrix of the residuals.
