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