So the aim is to solve the equation $(\Box+m^2)\phi(\vec{x},t)=0$ for $\phi$ ($m=0$ in <PERSON>'s example, but we'll leave it in). Note that (as <PERSON> writes) $$(\Box+m^2)\phi(\vec{x},t)=(\partial_t^2-\vec{\nabla}^2+m^2)\phi(\vec{x},t)=0\tag{(1)}$$ Something you will get used to is flipping between differential operators in position space and their form in Fourier space. The Fourier conjugates of $\Box$ and $\Delta=\vec{\nabla}^2$ are namely $-p^2$ and $-\vec{p}^2$, respectively. 418
To see how this works, consider the field expressed in terms of its $\vec{p}$-space Fourier conjugate, which we will call $a_\vec{p}(t)$: $$\phi(\vec{x},t)=\int\frac{d^3\vec{p}}{(2\pi)^3}a_\vec{p}(t)e^{i\vec{p}\cdot\vec{x}}.$$ Insering this into eq. 1 then gives \begin{align} (\Box+m^2)\phi(\vec{x},t)&=\int\frac{d^3\vec{p}}{(2\pi)^3}(\partial_t^2-\vec{\nabla}^2+m^2)a_\vec{p}(t)e^{i\vec{p}\cdot\vec{x}}\ &=\int\frac{d^3\vec{p}}{(2\pi)^3}(e^{i\vec{p}\cdot\vec{x}}\partial_t^2a_\vec{p}(t)-a_\vec{p}(t)\vec{\nabla}^2e^{i\vec{p}\cdot\vec{x}}+m^2a_\vec{p}(t)e^{i\vec{p}\cdot\vec{x}})\ &=\int\frac{d^3\vec{p}}{(2\pi)^3}(\partial_t^2+\vec{p}^2+m^2)a_\vec{p}(t)e^{i\vec{p}\cdot\vec{x}}\ &=0 \end{align*} So we find that the Fourier coefficients for each $\vec{p}$ are solutions to the conjugate equation to (1): $$(\partial_t^2+\vec{p}^2+m^2)a_\vec{p}(t)=0$$ which should be familiar as the differential equation for simple harmonic motion, solved by $a_\vec{p}(t)=a_\vec{p}e^{-i\omega t}$ where $\omega=\sqrt{\vec{p}^2+m^2}$ and $a_\vec{p}$ is constant in time (but of course depends on $\vec{p}$). The final step is to realize that $\phi^\dagger(\vec{x},t)$ is also a solution to (1) (just take the Hermitian conjugate of both sides), so we arrive at the full general solution $$\phi(\vec{x},t)=\int\frac{d^3\vec{p}}{(2\pi)^3}\left(a_\vec{p}e^{-ipx}+a^\dagger_\vec{p}e^{ipx}\right)$$ with $px=\omega t-\vec{p}\cdot\vec{x}$. 281