Step 1: Write second polynomial below the first one. Making sure like terms are lined up.
$$ \begin{array}{lrrr} & 3x^2 & -7x & 12 \\ \color{red}{ - } & x^2 & -8x & 18 \\ \hline \end{array} $$Step 2: Change ALL the signs in the second row.
$$ \begin{array}{lrrr} & 3x^2 & -7x & 12 \\ \color{red}{ - } & -x^2 & 8x & -18 \\ \hline \end{array} $$Step 3: Combine like terms (add each column):
$$ \begin{array}{lrrr} & 3x^2 & -7x & 12 \\ \color{red}{ - } & -x^2 & 8x & -18 \\ \hline & 4x^2 & -15x & 30 \end{array} $$