Let $p$ be an odd prime.
If $a$ is an integer with $\gcd(a,p)=1$, then
$$
a^{\large{\frac{p-1}{2}}}
\equiv
\begin{cases}
1\;(\text{mod}\;p)&\text{if $a$ is a quadratic residue, mod $p$}\\[4pt]
-1\;(\text{mod}\;p)&\text{if $a$ is a quadratic non-residue, mod $p$}\\
\end{cases}
$$
Now suppose $a,b$ are integers such that $\gcd(a,p)=1$ and $\gcd(b,p)=1$. Further suppose $a,b$ are both quadratic non-residues, mod $p$.
\begin{align*}
\text{Then}\;\;a^{\large{\frac{p-1}{2}}}&\equiv -1\;(\text{mod}\;p)\\[4pt]
b^{\large{\frac{p-1}{2}}}&\equiv -1\;(\text{mod}\;p)\\[8pt]
\text{hence}\;(ab)^{\large{\frac{p-1}{2}}}&\equiv 1\;(\text{mod}\;p)\\[4pt]
\end{align*}
It follows that for integers $a,b$ with $\gcd(a,p)=1$ and $\gcd(b,p)=1$, at least one of $a,b,ab$ is a quadratic residue, mod $p$.
Therefore at least one of $-1,2,-2$ is a square, mod $p$.
Note: The claim is that at least one is a square, not necessarily exactly one.
As Lord Shark the Unknown points out, it could be all three (e.g., for $p=17$).
Now suppose after testing $-1,2,-2$, you've found one of them, $s$ say, which is a square, mod $p$, and you want to find an integer $r$ such that $r^2 \equiv s\;(\text{mod}\;p)$. In other words, you want to actually find a square root of $s$, mod $p$. For that task, the following link
$\qquad$http://course1.winona.edu/eerrthum/13Spring/SquareRoots.pdf
describes an algorithm to find $r$.