Given an integer $n>2$, prove that there are infinitely many primes $p$ such that $p\not\equiv1\text{ mod }n$.
I read about the question here when $n=5$, where they used that $n$ itself is a prime. However, how should I prove it for any natural $n$? I got the hint "consider the polynomial $nx-1$" and tried to prove by contradiction, buy I couldn't go any further.
Thank you!