You can factor the numerator z^2 - 4 = (z + 2) (z - 2)
And the denominatior z^2 + z + 12 = (z + 4)(z - 3)
That permits to write the quotient as:
(z + 2)(z - 2) ___________
z - 3 _______________
z + 2 ___________
(z + 4)(z - 3)
Now you can multiplicate the numerator of the numerator times the denominator of the denominator, and multtiplicate the denominator of the numerator times the numerator of the denominator to obtain:
(z + 2)(z - 2)(z + 4)(z - 3) ____________________
(z - 3)((z + 2)
Cancel the factors (z - 3) and (z + 2) because they are in both the numerator and the denominator =>
(z - 2)(z + 4) = z^2 + 2z - 8
The restrictions are that none of the cancelled factors can be 0, so z ≠ 3 and z ≠- 4.