Does $T(x)$ represent a $c$ number or an operator in the second quantization? In the book quantum theory of many-particle systems by Fetter and Walecka, section 1.2, equation (2.4), the Hamiltonian writes:
$$
\hat{H} = \int d^3 x \hat{\psi}^\dagger(x) T(x) \hat{\psi}(x)
$$
The comment below the equation says:

The quantities $\hat{\psi}$ and $\hat{\psi}^\dagger$ are not wave
functions, however, but field operators; thus in second quantization
the fields are the operators and the potential and kinetic energy are
just complex coefficients.

I am a bit confused because on the one hand:
let $\hat{\psi} = \sum_k e^{ikx} c_k$, and $T(x)$ as an operator $-\hbar^2\nabla^2/2m$, one can smoothly get the ordinary second quantization form $\hat{H}=\sum_k\frac{\hbar^2k^2}{2m}c_k^\dagger c_k$.
On the other hand (assume bosons for simplicity):
$$
[\hat{\psi}(x),\hat{H}] = [\hat{\psi}(x), \int d^3 z \hat{\psi}^\dagger(z) T(z) \hat{\psi}(z)] = \int d^3 z\left([\hat{\psi}(x),  \hat{\psi}^\dagger(z) ] T(z) \hat{\psi}(z) + \hat{\psi}^\dagger(z)[\hat{\psi}(x), T(z)]\hat{\psi}(z) + \hat{\psi}^\dagger(z) T(z)[\hat{\psi}(x), \hat{\psi}(z)]\right) = T(x) \hat{\psi}(x)
$$
which is obtained using $[\hat{\psi}(x), \hat{\psi}^\dagger(z)]=\delta(x-z)$, $[\hat{\psi}(x), \hat{\psi}(z)]=0$, and assume T(x) is just a c number.
 A: There are two different sorts of operators that you have to keep in mind. One type of operators regards the ones that act on the Hilbert space of the quantum field (usually called the Fock space). The other sort are the operators that act on complex functions, such as the differentiation, multiplication and the Laplacian.
What is meant there is that $T(x)$ is not an operator that acts in the Hilbert space of the quantum field. It is an operator that acts on complex functions (and gets extended to formally act on quantum fields). In the computation you show you don't have to treat $T(x)$ as a number, you just have to assume it acts as a differential operator in the functions. In what follows I will denote the application of $T(z)$ in $\psi(z)$ (as a differential operator) by $T(z)[\psi(z)]$. Notice in particular that $T(z)$ differentiates only operators that depend on the variable $z$ (it does not affect $\psi(x)$, for instance). The computation then reads
$$
[\hat{\psi}(x),\hat{H}] = [\hat{\psi}(x), \int d^3 z \hat{\psi}^\dagger(z) T(z) \hat{\psi}(z)] \\
= \int d^3 z\left([\hat{\psi}(x),  \hat{\psi}^\dagger(z) ] T(z) \hat{\psi}(z) + \hat{\psi}^\dagger(z)[\hat{\psi}(x), T(z)]\hat{\psi}(z) + \hat{\psi}^\dagger(z) T(z)[\hat{\psi}(x), \hat{\psi}(z)]\right)\\
= \int d^3 z\left(\delta(x-z) T(z) \hat{\psi}(z) + \hat{\psi}^\dagger(z)\hat{\psi}(x)T(z)[\hat{\psi}(z)]- \hat{\psi}^\dagger(z)T(z)[\hat{\psi}(x)\hat{\psi}(z)] + \hat{\psi}^\dagger(z) T(z)[\hat{\psi}(x) \hat{\psi}(z)]-\hat{\psi}^\dagger(z)\hat{\psi}(x)  T(z)[\hat{\psi}(z)]\right).$$
Now, the first term will give the desired result of $T(x)\hat{\psi}(x)$, but in the other terms you have a differential operator that differentiates with respect to $z$, so that the functions of $x$ are unaffected. That is, $T(z)[\hat{\psi}(x) \hat{\psi}(z)]=\hat{\psi}(x) T(z)[\hat{\psi}(z)]$. Thus, the remaining terms cancel.
