In this answer, I'll use units with $c=1$, but to be explicit I'll include factors of $\hbar$.
For uncharged, scalar particles in empty Minkowski space, the modes can be chosen to be eigenstates of the spatial momentum operator in each direction. This leads to the idea that you can label the models by the spatial momenta, $\vec{p}$, or equivalently the wavenumbers, $\vec{k}$.
The energy for one quantum with a given set of momenta $\vec{p}$ is fixed by the usual relativistic formula $(E^{(1)}_\vec{p})^2=p^2+m^2$, or in terms of frequency and wavenumbers the dispersion relation $\omega_\vec{k}^2=k^2+m^2/\hbar^2$. To summarize,
$$
(E^{(1)}_\vec{p})^2=\vec{p}^2+m^2 = \hbar^2 \vec{k}^2 + m^2 = \hbar^2 \omega_\vec{k}^2
$$
Within this formula, you might recognize the famous equation $E^{(1)}_{\vec{p}} = \hbar \omega_\vec{k}$, but notice that the interpretation is that the equation holds for the energy of one quanta of momenta $\vec{p}$; it is not a general formula for energy of any number of quanta with different momenta (we'll get to that later).
Note that the energy $E^{(1)}_\vec{p}$ is a function of the momenta (much like the frequency $\omega_\vec{k}$ is a function of the wavenumbers).
The total energy in mode $\vec{p}$ (or mode $\vec{k}$) -- summing over all quanta -- depends on the number of quanta $n_{\vec{p}}$ in that mode, by the equation
$$
E^{\rm (tot)}_{\vec{p}} = \left(n_\vec{p} + \frac{1}{2}\right) E_{\vec{p}}^{(1)} = \left(n_\vec{p} + \frac{1}{2}\right) \hbar \omega_\vec{k}
$$
The $\frac{1}{2}$ term is due to vacuum fluctuations, which are independent of the occupation number. Note that $\omega_\vec{k}$ does not depend on the occupation numbers.
The total energy in the field comes from a sum over the energies of each mode
$$
E^{\rm (tot)} = \sum_{\vec{p}} E^{(\rm tot)}_\vec{p} = \sum_{\vec{p}} \left(n_\vec{p} + \frac{1}{2}\right) E^{(1)}_{\vec{p}} = \sum_{\vec{k}} \left(n_\vec{k} + \frac{1}{2}\right) \hbar \omega_\vec{k}
$$
The sum here can be interpreted literally if we are working in a box of a finite size (leading to discrete momenta), or else can be replaced with an integration over momenta if we are careful about the measure.