If $p\geq 5$ is a prime number, show that $p^2+2$ is composite.
If $p$ is a prime larger than $3$, then $p \equiv 1$ mod $3$ or $p \equiv 2$ mod $3$, hence in either case $p^2 + 2 \equiv 0$ mod $3$. Meaning $3$ divides $p^2 +2$. $p^2 + 2$ cannot be equal to $3$, so it must indeed be composite.
I suppose the reason is that $p^2 + 2$ is always divisible by 3; hence, taking a quotient by any multiple of 3 will allow you to prove the result. On the other hand, the number $p^2 + 2$ will never be divisible by 2, so you should not expect taking the numbers mod 4 to give you any information.