[guided]We start from the hypotheses that $P$ is finitely generated and projective, and we must manufacture a finite free module that contains $P$ as a direct summand. Since $P$ is finitely generated, choose elements $x_1,\dots,x_n\in P$ that generate $P$, with $n\ge 1$. In the special case $P=0$, we may take $n=1$ and $x_1=0$, so the convention that natural numbers start at $1$ causes no difficulty.
Define a map from the finite free right module $R^n$ onto $P$ by
\begin{align*}
\pi:R^n \to P, \qquad (r_1,\dots,r_n)^\top \mapsto \sum_{i=1}^n x_i r_i.
\end{align*}
This is right $R$-linear: for $a,b\in R$, vectors $v=(r_1,\dots,r_n)^\top$ and $w=(s_1,\dots,s_n)^\top$ in $R^n$, one has
\begin{align*}
\pi(va+w b)=\sum_{i=1}^n x_i(r_i a+s_i b)=\left(\sum_{i=1}^n x_i r_i\right)a+\left(\sum_{i=1}^n x_i s_i\right)b=\pi(v)a+\pi(w)b.
\end{align*}
It is surjective precisely because the elements $x_1,\dots,x_n$ generate $P$.
Now we use projectivity in its lifting form. The map $\pi:R^n\to P$ is surjective, and the identity map $\operatorname{id}_P:P\to P$ is a right $R$-linear map. Since $P$ is projective, there exists a right $R$-linear map $s:P\to R^n$ such that
\begin{align*}
\pi\circ s=\operatorname{id}_P.
\end{align*}
This equation says that $s$ is a section of $\pi$.
Let $Q=\ker \pi$. We claim that $R^n$ is the internal direct sum of $s(P)$ and $Q$. Define
\begin{align*}
\Phi:P\oplus Q \to R^n, \qquad (x,q)\mapsto s(x)+q.
\end{align*}
The map $\Phi$ is right $R$-linear because both $s$ and the inclusion $Q\subset R^n$ are right $R$-linear. If $\Phi(x,q)=0$, then $s(x)+q=0$. Applying $\pi$ gives
\begin{align*}
0=\pi(s(x)+q)=\pi(s(x))+\pi(q)=x+0=x.
\end{align*}
Thus $x=0$, and then $q=0$, so $\Phi$ is injective.
To prove surjectivity, take an arbitrary vector $v\in R^n$. Define $x=\pi(v)\in P$ and define $q=v-s(\pi(v))\in R^n$. Then
\begin{align*}
\pi(q)=\pi(v)-\pi(s(\pi(v)))=\pi(v)-\pi(v)=0,
\end{align*}
so $q\in Q$. With this choice,
\begin{align*}
v=s(\pi(v))+q=\Phi(\pi(v),q).
\end{align*}
Hence $\Phi$ is surjective. Therefore $\Phi$ is an isomorphism of right $R$-modules, and $P\oplus Q\cong R^n$.[/guided]