This question has $2$ singularities at $+i$ and $-i$. I am not sure how to solve.

This question has $2$ singularities at $+i$ and $-i$. I am not sure how to solve.

On
Let
$$I=\oint_{|z|=2}f(z)\,dz\,,\;f(z)=\frac{e^z}{z^2+1}=:\frac{P(z)}{Q(z)}$$
and note that $Q'(z)=2z$.
By Cauchy's residue theorem, the contour integral is equal to
$$I=2\pi i[Res(f;i)+Res(f;-i)]$$
Since $z=i$ and $z=-i$ are simple poles of $f$, we have
$$Res(f;i)=\frac{P(i)}{Q'(i)}=\frac{e^i}{2i}\\Res(f;-i)=\frac{P(-i)}{Q'(-i)}=\frac{e^{-i}}{-2i}$$
It follows that
$$I=2\pi i\frac{e^i-e^{-i}}{2i}=2\pi i\frac{2i\sin1}{2i}=2\pi i\sin1$$
The residue theorem states that the integral is $i 2 \pi$ times the sum of the residues at the poles $z=\pm i$, because those poles are located within the given contour. The residues at the poles are, for a function
$$f(z) = \frac{a(z)}{b(z)}$$
equal to $a(z_k)/b'(z_k)$, where $z_k$ is a root of $b(z)$. Then the integral is equal to
$$i 2 \pi \left (\frac{e^{i}}{2 i} + \frac{e^{-i}}{-2 i}\right) = i 2 \pi \sin{1}$$