I understand the $\chi^2$ test tests the model fit based on the comparison between the observed and null covariance matrices. Can someone explain to me how to compute the null matrix?
First, to answer your question, the null matrix is (usually) the matrix with just the variances in the diagonal, and zeroes in the off diagonal. If it were a correlation matrix it would be an identity matrix. The incremental fit indices compare the chi-square of the fitted model to the chi-square of the null model.
Second, the $\chi^2$ test does not compare the observed and null matrices, it compares the observed and saturated matrices. It is the multivariate test that all of the residuals (i.e. the difference between the fitted and observed matrices) is equal to zero.