In class my professor gave an example where $M$ is the $\mathbb R[x]$-module given by $\mathbb{R^{3}}$ with $x$-action given by
$$A = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \\ \end{pmatrix} $$ He then went on to show how for submodules $L$ and $P$ of $M$,
$$M \cong L \oplus P$$ where $L$ is the line through $(1,1,1),(0,0,0)$ $\in \mathbb{R^{3}}$ and
$$P = \{(a,b,c) \in \mathbb{R^{3}}|a+b+c=0\}$$
I understand $L$ is just an eigenvector from $A$, but I'm not sure how he figured out $P$ to make $M$ the direct sum of $L$ and $P$.