Example 4 Find all prime numbers $p$ and positive integers $m$ that satisfy $2 p^{2}+p+8=m^{2}-2 m$. ${ }^{[4]}$
(2010, "Mathematics Weekly Cup" National Junior High School Mathematics Competition).
If $p=2$, then $18=m^{2}-2 m$, that is,
$$
m^{2}-2 m-18=0,
$$

which has no integer solutions, a contradiction.
Therefore, $p \geqslant 3$.
$$
\begin{array}{l}
\text { By } 2 p^{2}+p+8=m^{2}-2 m \\
\Rightarrow 2 p^{2}+p=m^{2}-2 m-8 \\
\Rightarrow p(2 p+1)=(m-4)(m+2) .
\end{array}
$$

Since $p, 2 p+1, m+2$ are all positive integers, from equation (1) we know
$$
m-4>0.
$$

Since $p$ is a prime number, from equation (1) we know
$$
p \mid(m-4) \text { or } p \mid(m+2).
$$

If $p \mid(m-4)$, let $m-4=k p\left(k \in \mathbf{N}_{+}\right)$, substituting into equation (1) and rearranging gives
$$
\left(2-k^{2}\right) p=6 k-1.
$$

Solving this, we get $k=1$.
Thus, $p=5, m=p$.
If $p \mid(m+2)$, let $m+2=k p\left(k \in \mathbf{N}_{+}\right)$, substituting into equation (1) and rearranging gives
$$
\begin{array}{l}
\left(k^{2}-2\right) p=6 k+1 \\
\Rightarrow k \geqslant 2, \text { and } 6 k+1 \geqslant 3\left(k^{2}-2\right) \\
\Rightarrow k=2 .
\end{array}
$$

In this case, equation (2) does not hold.
In summary, $p=5, m=9$.