Answer
$a_n=6(-3)^{n-1}$
Work Step by Step
Here, we have $a_n= a_1r^{(n-1)}$ for the Geometric series.
We are told that $a_2=-18$ and $r=-3$
Here, we have $a_2=(a_1) \times (-3)^{(2-1)} \implies -18=(a_1) \times (-3)$
or, $a_1=6$
Now, $a_n=a_1 \times r^{n-1}$
Hence, $a_n=6(-3)^{n-1}$