I am quite familiar with the usual OLS estimate for $\boldsymbol\beta$, given by $$\hat{\boldsymbol\beta} = (X^{T}X)^{-1}X^{T}\mathbf{Y}$$ for the linear model $\mathbf{Y} = X\boldsymbol\beta + \boldsymbol\epsilon$.
My professor presented that instead of assuming $\text{Var}[\mathbf{Y}] = \sigma^2I$ ($I$ being the identity matrix), if $\text{Var}[\mathbf{Y}] = \Sigma$, then $$\hat{\boldsymbol\beta} = (X^{T}\Sigma^{-1}X)^{-1}X^{T}\Sigma^{-1}\mathbf{Y}\text{.}$$
This was presented without proof. How is this derived? I don't see where in particular the original derivation is dependent on $\text{Var}[\mathbf{Y}] = \sigma^2I$.