I want to prove the partial fraction decomposition:
\begin{align}\frac{\pi}{\sin \pi z} = \frac{1}{z} + 2z\sum\limits _{n=1} ^{\infty} \frac{(-1)^n}{z^2-n^2} \end{align}
with the help of the partial fraction decomposition of \begin{align} \pi \cot\pi z = \frac{1}{z} + 2z\sum\limits _{n=1} ^{\infty} \frac{1}{z^2-n^2}. \end{align}
Consider the Fourier series of $\cos{\alpha x}$, considered as a function on $[-\pi,\pi]$ (yes, this is perverse): it satisfies the Dirichlet conditions, so on the interior, we have $$ \cos{\alpha x} = \frac{1}{2}a_0+\sum_{k=1}^{\infty} a_k \cos{kx}, $$ where we find $a_k$ with the usual formula, $$ a_k = \frac{1}{\pi}\int_{-\pi}^{\pi} \cos{\alpha x} \cos{kx} \, dx = \frac{(-1)^k 2\alpha\sin{\pi\alpha}}{\pi(\alpha^2-k^2)}, $$ by an easy calculation. Oh dear, now it's fairly obvious what's about to happen: $$ \cos{\alpha x} = \frac{\sin{\pi\alpha}}{\pi \alpha}+\sum_{k=1}^{\infty} \frac{(-1)^k 2\alpha\sin{\pi\alpha}}{\pi(\alpha^2-k^2)} \cos{kx}. $$ Now set $x=0$ and multiply everything by $\pi/\sin{\pi \alpha}$. You can do the same thing for the cotangent by setting $x=\pi$.
To get from the cotangent to the cosecant, we go hunting for a trigonometric identity. Let's think about where the poles of each are: $\csc{\pi z}$ has poles at integers, as does $\cot{\pi z}$, but the residues alternate for the $\csc{\pi z}$. Therefore, can we make a linear combination of cotangents that has these poles? If you think for a few minutes, you come up with $$ \cot{\tfrac{1}{2}\pi z}-\cot{\pi z}, $$ which it is easy to verify works: $$ \frac{\cos{x}}{\sin{x}}-\frac{\cos{2x}}{\sin{2x}} = \frac{\cos{x}}{\sin{x}}-\frac{2\cos^2{x}-1}{2\sin{x}\cos{x}} = \frac{1}{2\sin{x}\cos{x}} = \csc{2x} $$ Now we just have to fiddle with the series expansions.
$$ \pi\cot{\tfrac{1}{2}\pi z}-\pi\cot{\pi z} = \frac{2}{z} + \sum_{n=1}^{\infty} \frac{z}{z^2/4-n^2}-\frac{1}{z} - \sum_{n=1}^{\infty} \frac{2z}{z^2-n^2} \\ =\frac{1}{z} + 2\sum_{n=1}^{\infty} \frac{2z}{z^2-(2n)^2} - \sum_{n=1}^{\infty} \frac{2z}{z^2-n^2}. $$ Ah, but hang on: the term with $n=2m$, even, in the second sum are half of the $m$th term of the first sum, whereas the odd terms have no corresponding terms. Hence the sums collapse into $$ \pi\csc{\pi z} = \frac{1}{z}+2z\sum_{n=1}^{\infty} \frac{(-1)^n}{z^2-n^2}. $$