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}{ 8x+3}\right) &= \underbrace{ \color{blue}{5x} \cdot \color{orangered}{8x} }_{\text{FIRST}} + \underbrace{ \color{blue}{5x} \cdot \color{orangered}{3} }_{\text{OUTER}} + \underbrace{ \left( \color{blue}{-2} \right) \cdot \color{orangered}{8x} }_{\text{INNER}} + \underbrace{ \left( \color{blue}{-2} \right) \cdot \color{orangered}{3} }_{\text{LAST}} = \\ &= 40x^2 + 15x + \left( -16x\right) + \left( -6\right) = \\ &= 40x^2 + 15x + \left( -16x\right) + \left( -6\right) = \\ &= 40x^2-x-6; \end{aligned} $$