Your question is of the form non linear homogeneous solution with constant coefficient.
so
$a_{n}=a^{\left(h\right)}_{n}+a^{\left(p\right)}_{n}$
where ,$\text{h=Homogeneous and p= polynomial}$
$\text{solve } \rightarrow a^{\left(h\right)}_{n}$
characteristics equation will be
$r=3 \Rightarrow root=3$
so,$a^{\left(h\right)}_{n}=\alpha *3^{n}$
now solve $ P_{n}=a^{\left(p\right)}_{n}$
Let $Q_{n} \: \text{be our trial equation },Q_{n}=cn+d$
Then our equation
$a_{n}=3*a_{n-1}+2 \: \text{becomes} \left ( c*n+d \right )=3*\left ( c*\left ( n-1 \right )*d \right )$
$\Rightarrow 2cn+2n+2d-3c=0$
$\Rightarrow n \left (2c+2\right )+2d-3c=0$
solving/comparing both sides,
$c=-1,d= - \frac {3}{2}$
Now assemble all things you obtained.
$a_{n}=a^{\left(h\right)}_{n}+a^{\left(p\right)}_{n}$
$a_{n}=\alpha *3^{n}+\left ( cn+d \right )$
$a_{n}=\alpha *3^{n}-n-\frac{3}{2}$
put value of $a_{1}=3,3=\alpha *3^{1}-1-\frac{3}{2},\alpha =\frac{11}{6}$
$a_{n}=\frac{11}{6} *3^{n}-n-\frac{3}{2} \text{is your answer}$