Check the final answer first, then review the worked steps.
$(\frac{1}{3})^x = 9 \implies (3^{-1})^x = 3^2 \implies 3^{-x} = 3^2 \implies -x = 2 \implies x = -2$