In this example we are multiplying two binomials so FOIL method can be used.
$$ \begin{aligned} \left( \color{blue}{ -7x^2-2}\right) \cdot \left( \color{orangered}{ x^2-1}\right) &= \underbrace{ \left( \color{blue}{-7x^2} \right) \cdot \color{orangered}{x^2} }_{\text{FIRST}} + \underbrace{ \left( \color{blue}{-7x^2} \right) \cdot \left( \color{orangered}{-1} \right) }_{\text{OUTER}} + \underbrace{ \left( \color{blue}{-2} \right) \cdot \color{orangered}{x^2} }_{\text{INNER}} + \underbrace{ \left( \color{blue}{-2} \right) \cdot \left( \color{orangered}{-1} \right) }_{\text{LAST}} = \\ &= -7x^4 + 7x^2 + \left( -2x^2\right) + 2 = \\ &= -7x^4 + 7x^2 + \left( -2x^2\right) + 2 = \\ &= -7x^4+5x^2+2; \end{aligned} $$