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