An element $m$ is irreducible if and only if it is not a unit, not equal to $0$, and whenever $m=ab$, either $a$ is a unit or $b$ is a unit. An element $p$ is prime if and only if $p$ is not a unit, is not zero, and whenever $p|ab$, either $p|a$ or $p|b$.
You are correct that in order to show that these rings are not factorials (unique factorization domain) it suffices to show that there is an irreducible element that is not prime.
However, you did not show that $9$ is irreducible; quite the contrary, you showed that it is reducible: if $3$ is a unit, then $9=3\times 3$ shows that $9$ is a unit (which it is not, since $\mathbb{Z}[\sqrt{10}]$ contains no noninteger rationals); so $3$ is not a unit, which means that you have shown that $9$ can be expressed as a product of two things that are not units. You showed that $9$ is reducible.
(If $u$ and $v$ are units, then $uv$ is a unit: multiply by $v^{-1}u^{-1}$).
So you have not yet produced elements that are irreducible but not prime; neither $9$ nor $18$ are irreducible.
On the other hand, if you can show that $3$ is irreducible in $\mathbb{Z}[\sqrt{10}]$, you're going to be pretty much done; similarly, if you can show either that $3$ or that $2$ are irreducible in $\mathbb{Z}[\sqrt{-17}]$ you'll be very close to done as well along these lines.