There are two ways to write a complex number: rectangular form, e.g., $x+iy$, and polar form, e.g., $re^{i\theta}$. The conversion between them uses trig functions: $$re^{i\theta}=r\cos\theta+ir\sin\theta\;.\tag{1}$$ Going in the other direction, $$x+iy=\sqrt{x^2+y^2}\,e^{i\theta}\;,$$ where $\theta$ is any angle such that $$\cos\theta=\frac{x}{\sqrt{x^2+y^2}}\;\text{ and }\sin\theta=\frac{y}{\sqrt{x^2+y^2}}\;.$$ The important thing for your argument is that $r=\sqrt{x^2+y^2}$.
The $r$ corresponding to $2+i$ is therefore $\sqrt{2^2+1^2}=\sqrt5$, and that corresponding to $2-i$ is $\sqrt{2^2+(-1)^2}=\sqrt5$ as well. The angles for $2+i$ is an angle $\theta$ whose cosine is $\frac2{\sqrt5}$ and whose sine is $\frac1{\sqrt5}$, while the angle for $2-i$ is an angle whose cosine is $\frac2{\sqrt5}$ and whose sine is $-\frac1{\sqrt5}$. It doesn’t matter exactly what they are; the important thing is that if we let the first be $\theta$, the second is $-\theta$, since $$\cos(-\theta)=\cos\theta\;\text{ and }\sin(-\theta)=-\sin\theta\;.$$
Substituting into $(1)$ gives you $$2+i=\sqrt5\cos\theta+i\sqrt5\sin\theta=\sqrt5(\cos\theta+i\sin\theta)=\sqrt5 e^{i\theta}$$ and $$2-i=\sqrt5\cos(-\theta)+i\sqrt5\sin(-\theta)=\sqrt5(\cos\theta-i\sin\theta)=\sqrt5 e^{-i\theta}\;.$$
Now use the fact that it’s easy to raise an exponential to a power:
$$\begin{align*}
(2+i)^n+(2-i)^n&=(\sqrt5)^n\left(e^{i\theta}\right)^n+(\sqrt5)^n\left(e^{-i\theta}\right)^n\\
&=(\sqrt5)^n\left(e^{in\theta}+e^{-in\theta}\right)\\
&=(\sqrt5)^n\Big(\big(\cos n\theta+i\sin n\theta\big)+\big(\cos(-n\theta)+i\sin(-n\theta)\big)\Big)\\
&=(\sqrt5)^n\Big(\cos n\theta+i\sin n\theta+\cos n\theta-i\sin n\theta\Big)\\
&=(\sqrt5)^n 2\cos n\theta\;.
\end{align*}$$