$\tan(\theta) = \frac{b}{a}$ is the correct form to determine $\theta$. Though, for this problem, there is no need to use this formula to represent $-3i$ in polar value. Keep in mind that $\theta$ is between $-\pi$ and $\pi$. That is the principal argument of the complex number, denoted by $\mathrm{Arg}$. Since the imaginary part of the given complex number is nonzero and real part is zero, we conclude that $\mathrm{Arg}(-3i) = -\frac{\pi}{2}$. Thus, we have
$$-3i = 3\left(\cos\left(-\dfrac{\pi}{2} \right) + i\sin\left(-\dfrac{\pi}{2} \right)\right) = 3e^{-\frac{\pi}{2}i}$$
Another way to write this in polar representation is to look at $-i$. Then,
$$-i = \cos\left(-\dfrac{\pi}{2} \right) + i\sin\left(-\dfrac{\pi}{2} \right) = e^{-\frac{\pi}{2}i}$$
Multiply that by $3$ to get the answer. You can determine $\theta$ and $r$, using the equations you indicated, but for this type of problem you don't need to. If you observe the real and imaginary parts of the complex number carefully, then you should quickly identify $r$ and $\theta$ without efforts.