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