Noting that, assuming $\mathbb{E}(X)$ is defined, $|\mathbb{E}(X)|<\infty$ if and only if $\mathbb{E}(|X|)<\infty$ suppose $X \geq 0$.
Define $(\Omega,\mathbb{P})$ the probability space and suppose $X : \Omega \to \mathbb{R}$ is a random variable, i.e. is measurable and not necessarly discrete.
An easy consequence of Fubini-Tonelli's theorems is that:
$$\mathbb{E}[X]=\int X d\mathbb{P}=\int_0^{+\infty}\mathbb{P}(X>t)dt$$
Thus, if in your case $X(\Omega)=\mathbb{N}$, the last integral simply became the summation you need.
In addition, if $X(\Omega)=\mathbb{N}$:
$$\sum_{n=1}^\infty n\mathbb{P}(n-1<X\leq n)=\sum_{n=0}^\infty \mathbb{P}(X>n)$$
holds for the same reasonement.
In fact if $A_n=\{\omega \in \Omega: n-1<X(\omega) \leq n \}$, then
$$\mathbb{E}[X]=\int X d\mathbb{P}=\sum_n \int_{A_n}X d\mathbb{P}=\sum_{n=1}^\infty n\mathbb{P}(n-1<X\leq n)$$
because $X$ is equal to $n$ in $A_n$ because $X(\Omega)=\mathbb{N}$.