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