If the equation cannot easily be written using the same base, take logarithms of both sides.
\[ a^x=b \quad \Longrightarrow \quad \log(a^x)=\log b \]
Then use the law:
\[ \log(a^x)=x\log a \]
Example: Solve
\[ 3^x=7 \]
Take logarithms:
\[ \log(3^x)=\log 7 \] \[ x\log 3=\log 7 \]
Therefore:
\[ x=\frac{\log 7}{\log 3} \]