The question asks the following. Find all numbers $n$ such that when you divide $n^2$ by $9$, you get a remainder of $2$.
If two numbers $a$ and $b$ differ by a multiple of $9$, then $a^2$ and $b^2$ have the same remainder on division by $9$. So you need only examine the candidates $n=0$, $n=1$, and so on up to $n=8$. Thus, effectively there is a smallish number of candidates. We might as well examine them all.
Try $n=0$. Then $n^2=0$. The remainder on division by $9$ is $0$, not $2$.
Try $n=1$. Then $n^2=1$. The remainder on division by $9$ is $1$, not $2$.
Try $n=2$. Then $n^2=4$. The remainder on division by $9$ is $4$, not $2$.
Try $n=3$. Then $n^2=9$. The remainder on division by $9$ is $0$, not $2$.
Try $n=4$. Then $n^2=16$. The remainder on division by $9$ is $7$, not $2$.
Continue calculating. You will find that the remainder is never equal to $2$.
There are shortcuts. For example, look at $(9-x)^2=81-18x+x^2$. This has the same remainder on division by $9$ as $x^2$. The numbers $n$ that I have not made explicit calculations for above are $n=9-4$, $9-3$, $9-2$, and $9-1$. Since we have checked that $4$, $3$, $2$, and $1$ don't work, we know without calculating that $5$, $6$, $7$, and $8$ can't work.
If instead of $9$ we had a largish number like $105$, we would certainly not want to examine, one by one, all possibilities. In that case the very nice approach by Jack D'Aurizio would lead us very quickly to the answer.