The fact that $\mathfrak{sl}_2(\mathbb{C})$ is a simple Lie algebra implies that every $2 \times 2$-matrix $A \in \mathbb{C}^{2\times 2}$ with $\mathrm{tr}(A) = 0$ can be expressed as a commutator of two matrices.
Is there any way to find two appropriate matrices? If I give you $A = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$, for example, is there any algorithm that can find matrices $B,C$ with $A = BC - CB$?
I think you can use the Pauli matrices $\sigma_1$, $\sigma_2$, $\sigma_3$. Traceless matrix $A$ can be decomposed as $A = \vec{a}\cdot\vec{\sigma}$. Meanwhile, any $B$, $C$ can be decomposed as $B = b_0I+\vec{b}\cdot\sigma$ and $C=c_0I+\vec{c}\cdot\sigma$, with commutator $[B,C] = 2i(\vec{b}\times\vec{c})\cdot\vec\sigma$.
So I think if you find two vectors $\vec{b}$ and $\vec{c}$ with $2i(\vec{b}\times\vec{c}) = \vec{a}$, then you have found $B$ and $C$ as $B = \vec{b}\cdot\sigma$ and $C = \vec{c}\cdot\sigma$.
For your example case, $$A = -i\sigma_2 = (0,-i,0)\cdot\vec{\sigma}\,.$$ That is, $\vec{a} = (0, -i, 0)$. So take $\vec{b} = ({1\over \sqrt{2}},0,0)$ and $\vec{c} = (0,0,{1\over\sqrt{2}})$. This gives $B = {1\over\sqrt{2}}\sigma_1$ and $C={1\over\sqrt{2}}\sigma_3$, with $$[B,C] = \frac{1}{2}[\sigma_1,\sigma_3]= \frac{1}{2}(-2i\sigma_2) = A\,.$$