Assume it is rational. So $6 = \frac{p^2}{q^2}$ and $(p,q)=1$. So $p^2 = 6q^2 = 2 (3q^2)$. So $p^2$ is even and so $p$ is even. Let $p=2r$. So $p^2 = 4r^2$. Putting back in the equation, I get $2r^2=3q^2$. So $3 \cdot q \cdot q$ is divisible by $2$. So $q^2$ is divisible by $2$ and so $q$ is even and it divisible by $2$. So $2$ is a common divisor of $p$ and $q$ which is a contradiction.
Is this correct? I could also have proved that $3$ is common factor of $p$ and $q$. Will that be correct too? Thanks.
Yes, you could have done it with any prime (that divides $6$ exactly). Specifically, what you are using is the fact that prime numbers are exactly the natural numbers $p\ge2$ such that for all $a,b$ such that $p\mid ab$, either $p\mid a$ or $p\mid b$.