Looking at eq 2.46 in Carrolls book; The metric is Lorentzian in General Relativity so that $g^{\mu \nu} = diag(-1,+1, ...,+1)$. This is the **canonical form** of the metric, where the signatures are, as written, -1 for the time coordinate and +1, ...,+1 for the spatial coordinates and where the metric is diagonal.

Next, we say that at any point p element of the manifold M there exists a coordinate system where the metric is canonical and further the following equation holds (eq 2.47 in Carrolls book):
$$g_{\hat{\mu} \hat{\nu}}(p) = \eta_{\hat{\mu} \hat{\nu}}.$$
We say the coordinate system at p is **locally intertial**. This is very important because we are assuming that **locally** curved space looks like flat space. An assumption which, in General Relativity, must be fulfilled.

Following equation 3.66 in Carrolls book, we have:
$g_{\hat{\mu} \hat{\nu}} = g(\hat{e}_{(\hat{\mu})},\hat{e}_{(\hat{\nu})})$, and by using formulae 3.64, 3.65 and 3.66 we have an actual algorithm on how to rewrite the metric into one defined on a coordinate system that is locally inertial. It should be noted that the $\hat{e}_{(\hat{\mu})}$ are basis vectors of the tangent space $T_p$.

Now, by taking equation 2.47, it is easy to derive eq 9.91 in Carrolls book:

$$\pi = \frac{\partial}{\partial(\nabla_0 \phi)} ( \sqrt{-g} \{-\frac{1}{2} g^{\mu\nu} \nabla_\mu \phi \nabla_\nu \phi - \cdots \})$$
$$    = \frac{\partial}{\partial(\nabla_0 \phi)} ( \sqrt{-g} \{-\frac{1}{2} g^{00} \nabla_0 \phi \nabla_0 \phi + g^{0i} \nabla_0 \phi \nabla_i \phi + g^{i0} \nabla_i \phi \nabla_0 \phi + g^{ij} \nabla_i \phi \nabla_j \phi - \cdots \})$$
by only looking at the first term, as the rest does not depend on $\nabla_0 \phi$, we further derive:
$$ \frac{\partial}{\partial(\nabla_0 \phi)} (g^{00} \nabla_0 \phi \nabla_0 \phi) = 2 g^{00} \nabla_0 \phi.$$
Just use the Leibniz rule. Then put this into the starting equation to get:
$$\pi = \sqrt{-g} \nabla_0 \phi.$$

We are actually done. But by assuming that the metric is Minkowskian locally we can calculate easily its determinant, which should be -1. Such that the $\sqrt{-g}$ term is equal to 1. So finally we get:
$$\pi = \nabla_0 \phi.$$

Please note that $g^{\mu\nu}$ is defined here to be $g^{\hat{\mu} \hat{\nu}}$ which is just a shorthand for $g^{\hat{\mu} \hat{\nu}}(p)$. So to make the computation clear.

As a notice, it is not clear why the author wrote the term $\sqrt{-g}$ explicitly in equation 9.91 ..