Example 2 Let $p>2$ be a prime, $p \nmid d$. Find the necessary and sufficient condition for the quadratic congruence equation
$$x^{2}-d \equiv 0(\bmod p)$$

to have 2 solutions.
Since
$$\begin{aligned}
x^{p-1}-1 & =\left(x^{2}\right)^{(p-1) / 2}-d^{(p-1) / 2}+d^{(p-1) / 2}-1 \\
& =\left(x^{2}-d\right) q(x)+d^{(p-1) / 2}-1,
\end{aligned}$$

by Theorem 5, the necessary and sufficient condition for the number of solutions to be 2 is
$$d^{(\rho-1) / 2}-1 \equiv 0(\bmod p)$$

Since $p>2$, the congruence equation (15) either has no solution or has exactly 2 solutions. Therefore, (16) is also the necessary and sufficient condition for (15) to have a solution. This provides another proof of Euler's criterion (Theorem 2 in §5). Additionally, note that
$$x^{p-1}-1=\left(x^{(p-1) / 2}-1\right)\left(x^{(p-1) / 2}+1\right),$$

so the number of solutions to the congruence equation (16) (considering $d$ as the variable $x$) is $(p-1) / 2$, meaning that there are exactly $(p-1) / 2$ quadratic residues modulo $p(>2)$. This provides another proof of Theorem 1 in §5. This method of proof may seem "too advanced" for quadratic residues, but it demonstrates its superiority when discussing higher-order residues (see Theorem 7, Theorem 8, Theorem 9).

Although congruence equations modulo $p$ of arbitrary degree can occur, the following theorem shows that we can always reduce them to congruence equations of degree $<p$.