https://en.wikipedia.org/wiki/Riemann_zeta_function
There are several methods to define finite sums for divergent series. See the wikipedia article for a comprehensive list:
We all agree about the value of a finite summation.
We all agree about the value of a sum when the summation is absolutely convergent.
We all (almost) agree when the summation converges, but the convergence is not absolute.
This is the standard definition that is used in a calculus course, but be aware that when the convergence is not absolute there are some minor problems here and there. It's much better if you have absolute convergence.
After that, the idea is that you can extend the definition of summation. The more easy way is https://en.wikipedia.org/wiki/Cesàro_summation but the other comment posted a link to a more generic article https://en.wikipedia.org/wiki/Divergent_series
Cesàro summation is fine, you don't get too many surprises using it. But when you extend too much the definition of summation you get more weird results, and you loose some properties of the standards summation, for example a+b+c+d+e+... = a + (b+c+d+e+...).
In particular, to get a finite result for 1+2+3+4+... you have to use extend the definition of summation a lot, perhaps too much, and there are many ways to do the extension, and not all of them give the same result.
If you have half an hour to spare, I highly recommend to watch "Ramanujan: Making sense of 1+2+3+... = -1/12 and Co." by Mathologer https://www.youtube.com/watch?v=jcKRGpMiVTw