You know the process of finding the inverse, so let's go through it step by step.
First, replace $h(x)$ with $y$, $\quad y = 3^x$. Then, switch the $x$ and the $y$, $\quad x = 3^y$. Now, you have to solve for $y$ to find the inverse function. We can't take the $y$-th root of both sides, so in order to solve for $y$, we want to find the exponent that turns 3 into $x$. This is what's called a logarithm. By definition. $y = \log_ax$ if and only if $x = a^y$, that is, $\log_ax$ is the exponent that turns the base $a$ into $x$.
With this in mind, the inverse of $h(x) = 3^x$ would be $h^{-1}(x) = \log_3x$.
To solve the equation $h^{-1}(x) = 2$ we use the above definition.
$ h^{-1}(x) = 2 \rightarrow \log_3x = 2 \rightarrow x = 3^2 \rightarrow x = 9.$