Subtract $ \dfrac{3}{a^2-1} $ from $ \dfrac{12}{a^2+2a+1} $ to get $ \dfrac{ \color{purple}{ 9a-15 } }{ a^3+a^2-a-1 }$.
To subtract raitonal expressions, both fractions must have the same denominator.
We can create a common denominator by multiplying the first fraction by $ \color{blue}{ a-1 }$ and the second by $\color{blue}{ a+1 }$.
$$ \begin{aligned} \frac{12}{a^2+2a+1} - \frac{3}{a^2-1} & = \frac{ 12 \cdot \color{blue}{ \left( a-1 \right) }}{ \left( a^2+2a+1 \right) \cdot \color{blue}{ \left( a-1 \right) }} -
\frac{ 3 \cdot \color{blue}{ \left( a+1 \right) }}{ \left( a^2-1 \right) \cdot \color{blue}{ \left( a+1 \right) }} = \\[1ex] &=\frac{ \color{purple}{ 12a-12 } }{ a^3-a^2+2a^2-2a+a-1 } - \frac{ \color{purple}{ 3a+3 } }{ a^3-a^2+2a^2-2a+a-1 } = \\[1ex] &=\frac{ \color{purple}{ 12a-12 - \left( 3a+3 \right) } }{ a^3+a^2-a-1 }=\frac{ \color{purple}{ 9a-15 } }{ a^3+a^2-a-1 } \end{aligned} $$