Let us assume that a stochastic process, $\{X[n], n=1, 2, \ldots\}$, is ergodic. Then, it is well known that $$\frac{1}{N}\sum_{n=1}^N f(X[t]) \longrightarrow \mathbb{E}[f(X)]\tag1\label{eq1}$$ with probability $1$ (or can be expressed as almost surely) as $N$ goes to infinity.
I have already seen the above result several times in many papers. For example, in the wireless communication system whose channel model follows an ergodic process, an infinitely long-term time average of something (e.g., data rate, power, etc.) is replaced equivalently with the average over the channel.
However, most papers do not provide an exact proof of this. Also, in stochastic process textbooks, they only say that a stochastic process, $\{X[n], n=1, 2, \ldots\}$, is ergodic if the following statement holds: $$\frac{1}{N}\sum_{n=1}^N X[t] \longrightarrow \mathbb{E}[X].\tag2\label{eq2}$$
How can I prove \eqref{eq1} from \eqref{eq2}?
The mean Ergodic theorem given in (1) is how it is usually stated in my experience (See e.g. wikipedia).
Here is a document that goes over the formulation of the ergodic theorem and gives an elegant proof for $L^2$-integrable functions due to von Neumann.
https://personalpages.manchester.ac.uk/staff/charles.walkden/magic/lecture05.pdf
For the general ergodic theorem requiring only $L^1$ integrability of $f$ see Durrett - Probability: Theory and Examples.