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