I am not sure if this is a appropriate question. If it isn't, let me know and I'll delete it.
$\textbf{Background}$
I am an undergraduate student and I'm very interested in number theory. I've tried to study alone some algebraic number theory and I believe that I know a lot of things about algebraic number fields and $p$-adic numbers, all using Neukirch's ANT book.
$\textbf{Question}$
I try to read a lot about number theory on the internet and I realize that a lot of complex analysis stuff is used. My question is basically: how does these complex analysis stuff, like Riemann Zeta function, relate explicitly to number theory? I asked a long time ago about the use of complex numbers in number theory and people told me about some results that used Gaussian Integers, for example to study primes that can be written as a sum of two squares in $\mathbb{Z}$, but I believe this fits more in the study of algebraic number fields and it is far away from the Riemann Zeta stuff.
Can someone give me sort of intuition or motivation on how does these complex analysis ideas relate to a problems involving integers or number theory in general? Thank you in advance.
Note: The following touches only a few aspects far from being representative for the wide connection of complex analysis with number theory.
From T. Apostols introductory section of his classic Modular Functions and Dirichlet Series in Number Theory:
We see from his intro that complex analysis plays a key role and also that the asymptotic study of function is essential for gaining insight.
In order to get information about the behavior of numerical sequences $a_n$ for large $n$, we study the corresponding generating functions $F(z)$ \begin{align*} F(z)=\sum_{n=0}^{\infty}a_nz^n \end{align*} as function of a complex variable $z$. Crucial for the asymptotic behavior is the behavior of the function near its singularities.
$$ $$
By integrating along a path in the complex plane and considering thereby so-called Ford circles for Farey series (you may want to look at these interesting objects) Rademacher found the following celebrated representation of $p(n)$ for $n\geq 1$ as convergent series:
and with $s(h,k)$ being the Dedekind sum \begin{align*} s(h,k)=\sum_{r=1}^{k-1}\frac{r}{k}\left(\frac{hr}{k}-\left[\frac{hr}{k}\right]-\frac{1}{2}\right) \end{align*}
Here is a last indication how important the study of the singularities in the complex plane of a function is.