[guided]The direct sum $M \oplus N$ keeps the two coordinates separate, so the natural candidate basis is obtained by placing the basis of $M$ in the first coordinate and the basis of $N$ in the second coordinate. For each $1 \le i \le m$, define
\begin{align*}
u_i := (e_i,0_N) \in M \oplus N.
\end{align*}
For each $1 \le j \le n$, define
\begin{align*}
v_j := (0_M,f_j) \in M \oplus N.
\end{align*}
We prove that
\begin{align*}
(u_1,\dots,u_m,v_1,\dots,v_n)
\end{align*}
is a basis of $M \oplus N$ by checking the two defining properties: spanning and linear independence.
For spanning, take an arbitrary element $(x,y) \in M \oplus N$. The first coordinate $x$ lies in $M$, and $(e_i)_{1 \le i \le m}$ is a basis of $M$, so there exist coefficients $a_i \in R$ for $1 \le i \le m$ such that
\begin{align*}
x = \sum_{i=1}^{m} a_i e_i.
\end{align*}
Similarly, the second coordinate $y$ lies in $N$, and $(f_j)_{1 \le j \le n}$ is a basis of $N$, so there exist coefficients $b_j \in R$ for $1 \le j \le n$ such that
\begin{align*}
y = \sum_{j=1}^{n} b_j f_j.
\end{align*}
The module structure on $M \oplus N$ is coordinatewise. Therefore
\begin{align*}
\sum_{i=1}^{m} a_i u_i+\sum_{j=1}^{n} b_j v_j
=
\left(\sum_{i=1}^{m} a_i e_i,\sum_{j=1}^{n} b_j f_j\right).
\end{align*}
Substituting the displayed expressions for $x$ and $y$ gives
\begin{align*}
\sum_{i=1}^{m} a_i u_i+\sum_{j=1}^{n} b_j v_j=(x,y).
\end{align*}
Since $(x,y)$ was arbitrary, the family spans $M \oplus N$.
For linear independence, suppose coefficients $a_i \in R$ for $1 \le i \le m$ and $b_j \in R$ for $1 \le j \le n$ satisfy
\begin{align*}
\sum_{i=1}^{m} a_i u_i+\sum_{j=1}^{n} b_j v_j=(0_M,0_N).
\end{align*}
Expanding the definitions of $u_i$ and $v_j$ yields
\begin{align*}
\left(\sum_{i=1}^{m} a_i e_i,\sum_{j=1}^{n} b_j f_j\right)=(0_M,0_N).
\end{align*}
Equality in $M \oplus N$ is equality in each coordinate, so
\begin{align*}
\sum_{i=1}^{m} a_i e_i=0_M
\end{align*}
and
\begin{align*}
\sum_{j=1}^{n} b_j f_j=0_N.
\end{align*}
Now the linear independence of the basis $(e_i)_{1 \le i \le m}$ forces $a_i=0_R$ for every $1 \le i \le m$, and the linear independence of the basis $(f_j)_{1 \le j \le n}$ forces $b_j=0_R$ for every $1 \le j \le n$. Thus every linear relation among the $u_i$ and $v_j$ is the zero relation, so the family is linearly independent.
We have proved both spanning and linear independence. Therefore the concatenated family
\begin{align*}
(u_1,\dots,u_m,v_1,\dots,v_n)
\end{align*}
is a basis of $M \oplus N$.[/guided]