To factor $ a^2b^3-3ab^3+2a-6 $ we can use factoring by grouping.
Group $ \color{blue}{ a^2b^3 }$ with $ \color{blue}{ -3ab^3 }$ and $ \color{red}{ 2a }$ with $ \color{red}{ -6 }$ then factor each group.
$$ \begin{aligned} a^2b^3-3ab^3+2a-6 &= ( \color{blue}{ a^2b^3-3ab^3 } ) + ( \color{red}{ 2a-6 }) = \\ &= \color{blue}{ ab^3( a-3 )} + \color{red}{ 2( a-3 ) } = \\ &= (ab^3+2)(a-3) \end{aligned} $$