The "$i$" should be included, thusly:
$z^2 - 10z + 30 = (z - 5 + i\sqrt{5})(z - 5 - i\sqrt{5}) ; \tag{1}$
without it, we have
$(z - 5 + \sqrt{5})(z - 5 - \sqrt{5}) = ((z - 5) + \sqrt{5})((z - 5) -\sqrt{5})$
$= (z - 5)^2 - (\sqrt {5})^2 = z^2 - 10z + 25 - 5$
$= z^2 - 10z + 20; \tag{2}$
on the other hand, with it:
$(z - 5 + i\sqrt{5})(z - 5 - i\sqrt{5}) = ((z - 5)+ i\sqrt{5})((z - 5) - i\sqrt{5})$
$= (z - 5)^2 - (i\sqrt{5})^2 = z^2 - 10z + 25 + 5$
$= z^2 - 10 z + 30, \tag{3}$
since $(i\sqrt{5})^2 = - 5$; in each of the above calculations we used the identity
$(a + b)(a - b) = a^2 - b^2; a, b \in \Bbb C. \tag{4}$
To complete the square for $z^2 - 10z + 30$, we proceed as follows:
$z^2 - 10z + 30 = 0;\tag{5}$
subtract $30$:
$z^2 - 10z = -30; \tag{6}$
add $25 = (-10/2)^2$:
$z^2 - 10z + 25 = -5; \tag{7}$
then
$(z - 5)^2 = z^2 -10z + 25 = -5 = (i\sqrt{5})^2, \tag{8}$
so
$(z - 5)^2 - (i\sqrt{5})^2 = 0, \tag{9}$
whence, via (4),
$((z - 5) + i\sqrt{5})((z - 5) - i\sqrt{5}) = 0; \tag{10}$
this shows the roots of $z^2 -10z + 30$ are $z - 5 \pm i\sqrt{5}$, so the factorization (1) binds.