I was reading that solution of $\mathbb{Z}[\sqrt{−n}]$ is not a UFD here Conclude that $\mathbb{Z}[\sqrt{−n}]$ is not a UFD.
But I do not understand this line "So either $d = 1, 2$ or $\gcd(y,\sqrt{-n}) \not = 1$ in which case $n|y$ because $y$ is a rational integer." Specifically, I do not understand the following:
1- why $d = 1, 2$ or $\gcd(y,\sqrt{-n}) \not = 1$?
2-and why in this case $n|y$?
3-and why $y$ is a rational integer?
Could someone explain this to me please?