To factor $ x^2y-8y-9x^2+72 $ we can use factoring by grouping.
Group $ \color{blue}{ x^2y }$ with $ \color{blue}{ -8y }$ and $ \color{red}{ -9x^2 }$ with $ \color{red}{ 72 }$ then factor each group.
$$ \begin{aligned} x^2y-8y-9x^2+72 &= ( \color{blue}{ x^2y-8y } ) + ( \color{red}{ -9x^2+72 }) = \\ &= \color{blue}{ y( x^2-8 )} \color{red}{ -9( x^2-8 ) } = \\ &= (y-9)(x^2-8) \end{aligned} $$