I've looked at several posts here and proofs elsewhere and it is not clicking in my brain.
Let $R$ a ring and $P$ be a direct summand of a free module. That is, there exists a (left) $R$-module $Q$ such that $F=P \oplus Q$ is free. Then, let $B= \{b_i\}$ be a basis for $F$. Further suppose we have an epimorphism $f:A \to B$ and a homomorphism $g:P \to B$.
Here is the bit that confuses me. Since $g$ is an epimorphism we can find $a_i \in A$ such that $f(a_i)=g(b_i)$ for each $i$. $g$ is only a map from $P \to B$ not from $F \to B$. How are we able to make a consideration like this? Why does it work out?
From there, define $\bar{h}:F \to A$
$$\bar{h}(\sum r_ib_i)=\sum r_im_i$$
We can check that this map is well-defined and what not and restricting to $P$ gives the desired result.