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