Unique factorization theorem in algebraic number theory Consider the set $S = a + b \sqrt {-6}$, where $a$ and $b$ are integers. Now, to prove that unique factorization theorem does not hold in set $S$, we can take the example as follows:
$$
10 = 2 \cdot 5 = (2+\sqrt {-6}) (2-\sqrt {-6})
$$
"Thus we can conclude  that there is not unique factorization of 10 in set $S$. Note that this conclusion does not depend on our knowing that $2+\sqrt {-6}$ and $2-\sqrt {-6}$ are primes; they actually are, but it is unimportant in our discussion. "
Can someone explain why the conclusion is independent of nature of $2+\sqrt {-6}$ and $2-\sqrt {-6}$. Basically, unique factorization theorem is based on the fact that factors are primes. So, why is it independent?
Note: This is from the book An Introduction to the Theory of Numbers, 5th Edition by Ivan Niven, Herbert S. Zuckerman, and Hugh L. Montgomery.

Before I answer, there are a few things I'd like to clarify.
First of all, by "unique factorization theorem" we need to know what domain we're working in. Usually it's good ol' $\mathbb{Z}$ (the integers, algebraic integers of degree 1), so people don't bother to specify because it's understood.
But are you sure the book actually says "that unique factorization theorem does not hold in set $S$"? It feels like you've added an extra word, "theorem". I've read that chapter in the 4th edition and I suppose it's possible it also has that extra word but I just skipped it over.
The meaning is the same: $\mathbb{Z}[\sqrt{-6}]$ (or $\textbf{Z}[\sqrt{-6}]$ or $\mathbb{Z} + \mathbb{Z}\sqrt{-6}$, depending on your notation preferences) is not a unique factorization domain (UFD); in it, unique factorization does not hold.
Niven et al, as well as Bolker and other contemporaries, use "prime" in certain contexts when most modern authors would use "irreducible". If $p$ is irreducible and $ab = p$, then either $a$ is a unit or $b$ is a unit (in $\mathbb{Z}[\sqrt{-6}]$, the only units are 1 and $-1$).
But for $p$ to be prime, we have the additional requirement that for every case of $p \mid ab$, then either $p \mid a$ or $p \mid b$. This doesn't upset anything in $\mathbb{Z}$. For example, $10 \mid 5 \times 8$ but $10 \nmid 5$ and $10 \nmid 8$. But this does shake things up in domains like $\mathbb{Z}[\sqrt{-6}]$ that don't have unique factorization.
The more common example that unique factorization does not hold in $\mathbb{Z}[\sqrt{-6}]$ is $6 = 2 \times 3 = (-1)(\sqrt{-6})^2$. But $10 = 2 \times 5 = (2 - \sqrt{-6})(2 + \sqrt{-6})$ is also of pedagogical value.
If you want to check that 2, 5, $2 - \sqrt{-6}$ and $2 + \sqrt{-6}$ are all irreducible, that's good, I think you should check that this is true. But you don't have to, at least not for all of them. First we verify that 2 and 5 are irreducible, and then it's enough to see that $$\frac{2 - \sqrt{-6}}{2}$$ and $$\frac{2 - \sqrt{-6}}{5}$$ take us out of $\mathbb{Z}[\sqrt{-6}]$, and likewise with $2 + \sqrt{-6}$, and the same goes if we flip the fractions. This doesn't rule out the possibility that $2 - \sqrt{-6}$ and $2 + \sqrt{-6}$ could be factorized further, but Niven et al don't consider it necessary to do all that.
Now, suppose someone tells you that $$28 = 2^2 \times 7 = (2 - 2 \sqrt{-6})(2 + 2 \sqrt{-6}).$$ This is technically true, but we have incomplete factorizations on both sides. Clearly $$\frac{2 + 2 \sqrt{-6}}{2} = 1 + \sqrt{-6},$$ and we can say something very similar for $2 - 2 \sqrt{-6}$.
Thus the two different factorizations of 28 shown above are not distinct from each other because both numbers in the latter factorization are divisible by the first number in the former (without the exponent), and by dividing that number out of the latter, we obtain the factorization of the second number of the former.
We can't do that with the two factorizations of 10 you've been given, so even if we don't check whether $2 - \sqrt{-6}$ and $2 + \sqrt{-6}$ are irreducible, we must still conclude that we have been given two distinct factorizations of 10. Therefore there can be no unique factorization theorem for $\mathbb{Z}[\sqrt{-6}]$.
