I know this question has been widely answered here, but without using Fourier analysis. Also there is a video referring to this trick but I want to use a different Fourier series.
First of Parseval's Theorem states: $\displaystyle{\dfrac{1}{\pi}\int_{-\pi}^{\pi}[f(x)]^2 = [a_0]^2+\sum_{n=1}^{\infty}[a_n]^2+[b_n]^2}$.
I calculate $a_0$ like $\frac{1}{2\,\pi}\,\int_{-\pi}^{\pi}f(x)\,\mathrm{dx}$ instead of $\frac{1}{\pi}\,\int_{-\pi}^{\pi}f(x)\,\mathrm{dx}$, so no need for $\frac{1}{2}\,a_0$
Here I'd like to involve the series of $\cosh(x)$ whose partition I have been asked for in a prior question.
It should be: $\displaystyle{\cosh(x) = \underbrace{\dfrac{\sinh(\pi)}{\pi}}_{a_0}+\sum_{n = 1}^{\infty}\underbrace{\color{red}{2}\,\dfrac{1}{\pi}\,\dfrac{\sinh(\pi)}{1+n^2}\,(-1)^n\,\cos(n\,x)}_{a_n}}$
Plugging those terms into the original theorem:
$$\begin{align} &\dfrac{1}{\pi}\int_{-\pi}^{\pi}\cosh^2(\pi) = \left(\dfrac{\sinh(\pi)}{\pi}\right)^2+\sum_{n=1}^{\infty}\left(\color{red}{2}\,\dfrac{1}{\pi}\,\dfrac{\sinh(\pi)}{1+n^2}\,(-1)^n\right)^2 \\\\ & 1+\dfrac{\sinh(2\,\pi)}{2\,\pi}= \dfrac{\sinh^2(\pi)}{\pi^2}\,\left[1+\sum_{n=1}^{\infty}\color{red}{4}\,\left(\dfrac{1}{1+n^2}\right)^2\right]\\\\ &\sqrt{\left(\dfrac{\pi^2}{\sinh^2(\pi)}+\dfrac{\sinh(2\,\pi)\,\pi}{2\,\sinh^2(\pi)}-1\right)\,\color{red}{\dfrac{1}{4}}} = \sum_{n=1}^{\infty}\dfrac{1}{1+n^2} \quad ? \end{align}$$
Actually the value is coming close to the approximated sum, but it's not exactly the same result...
Edit
I fixed the Fourier Series highlighting the missing term in red. On the other hand I eradicated some factors, not sure about making it worse. It's still differing from the approximation.
approximation $\approx 1,0767$
Therefore it works exactly like suggested by Stefan Lafon in the remarks: setting $x=\pi$
$\begin{align} &\cosh(\pi) = \dfrac{\sinh(\pi)}{\pi}+\displaystyle{\sum_{n=1}^{\infty}2\,\dfrac{1}{\pi}\,\dfrac{\sinh(\pi)}{1+n^2}}\\\\ &\Rightarrow \quad \dfrac{\cosh(\pi)\,\pi}{2\,\sinh(\pi)}-\dfrac{1}{2} =\displaystyle{\sum_{n=1}^{\infty}\dfrac{1}{1+n^2}} \end{align}$
It just remains a mystery why the method on top fails