Let $k$ be a commutative ring. There is a forgetful functor $$U : \mathsf{Coalg}_k \to \mathsf{Mod}_k$$ from $k$-coalgebras to $k$-modules. This has a right adjoint $R : \mathsf{Mod}_k \to \mathsf{Coalg}_k$, called the cofree coalgebra on a $k$-module. There are several ways to prove its existence, but let us assume that we have chosen an abstract approach (for example, by using some adjoint functor theorem). If necessary, let us assume that $k$ is a field. Can we derive from the universal property how the cofree coalgebra looks like explicitly?
So, given some $k$-module $M$ and a coalgebra $R(M)$ equipped with a natural bijection $\hom(C,R(M)) \cong \hom(U(C),M)$ for coalgebras $C$ , how can we make explicit what $R(M)$ is, i.e. what is the underlying $k$-module and its comultiplication? For example, by taking the coalgebra $C=(k \cdot x,\Delta(x)=x \otimes x,\varepsilon(x)=1)$, we see that $$\{a \in R(M) : \Delta(a)=a \otimes a, \, \varepsilon(a)=1\} \cong \hom(C,R(M)) \cong \hom(k \cdot x,M) \cong |M|.$$