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