[guided]Fix a time $t\in I$. The theorem assumes that $f:M\times I\to\mathbb{R}$ is smooth, that $(M,g(t))_{t\in I}$ is a smooth Ricci flow, and that $\tau:I\to(0,\infty)$ is smooth. Since $a(t)=(4\pi\tau(t))^{-n/2}>0$, the functions $f(\cdot,t):M\to\mathbb{R}$ and $u(\cdot,t):M\to(0,\infty)$ are smooth on the Riemannian manifold $(M,g(t))$. Thus the spatial chain rule and the divergence product rule apply to these functions and vector fields. The operator $\Delta_{g(t)}$ differentiates only in the spatial variable $x$, while the factor $(4\pi\tau(t))^{-n/2}$ depends only on time. Thus, when taking the spatial gradient, this prefactor behaves as a constant. From
\begin{align*}
u(x,t)=(4\pi\tau(t))^{-n/2}e^{-f(x,t)},
\end{align*}
the Chain Rule for the spatial gradient gives
\begin{align*}
\nabla u = -u\nabla f.
\end{align*}
Now apply the Laplace-Beltrami Operator with the convention $\Delta_{g(t)}h=\operatorname{div}_{g(t)}(\nabla h)$. Since $\nabla u=-u\nabla f$, we have
\begin{align*}
\Delta_{g(t)}u = \operatorname{div}_{g(t)}(-u\nabla f).
\end{align*}
Let $\mathfrak{X}(M)$ denote the space of smooth vector fields on $M$. The Product Rule for Divergence says that for a smooth scalar function $\phi: M\to\mathbb{R}$ and a smooth vector field $X\in\mathfrak{X}(M)$,
\begin{align*}
\operatorname{div}_{g(t)}(\phi X) = g(t)(\nabla \phi,X)+\phi\,\operatorname{div}_{g(t)}X.
\end{align*}
We apply this with $\phi=-u$ and $X=\nabla f$. This gives
\begin{align*}
\Delta_{g(t)}u = -g(t)(\nabla u,\nabla f)-u\operatorname{div}_{g(t)}(\nabla f).
\end{align*}
Because $\operatorname{div}_{g(t)}(\nabla f)=\Delta_{g(t)}f$, this becomes
\begin{align*}
\Delta_{g(t)}u = -g(t)(\nabla u,\nabla f)-u\Delta_{g(t)}f.
\end{align*}
Substituting $\nabla u=-u\nabla f$ into the first term yields
\begin{align*}
-g(t)(\nabla u,\nabla f) = -g(t)(-u\nabla f,\nabla f) = u|\nabla f|_{g(t)}^2.
\end{align*}
Therefore
\begin{align*}
\Delta_{g(t)}u
= u|\nabla f|_{g(t)}^2-u\Delta_{g(t)}f.
\end{align*}[/guided]