First we bring the differential equation into standard form:
\begin{equation*}
f'+\underset{p(x)}{\underbrace{\frac{3}{x-2}}}f=\underset{q(x)}{\underbrace{\frac{e^{-x}}{x-2}}}\text{.}
\end{equation*}
Since \(3\ln\abs{x-2}\) is an antiderivative of \(p(x)=3/(x-2)\text{,}\) we set the integrating factor to be
\begin{equation*}
v(x)=e^{3\ln\abs{x-2}}=\abs{x-2}^3=-(x-2)^3\text{,}
\end{equation*}
where the minus sign arises due to the fact that we assume \(x\leq 2\text{,}\) and hence \(x-2\leq 0\text{.}\) Next we compute (using integration by parts twice)
\begin{equation*}
\int v(x)q(x)\, dx=\int -(x-2)^2e^{-x}\, dx=(x-2)^2e^{-x}+2(x-2)e^{-x}+2e^{-x}+C=\underset{G(x)}{\underbrace{(x^2-2x+2)e^{-x}}}+C\text{.}
\end{equation*}
We conclude that the general solution is given by
\begin{equation*}
f(x)=\frac{G(x)}{v(x)}+\frac{C}{v(x)}=-\frac{x^2-2x+2}{(x-2)^3}e^{-x}-\frac{C}{(x-2)^3}\text{.}
\end{equation*}
Finally, the condition \(f(1)=-1\) implies that
\begin{equation*}
-\frac{1}{(-1)}e^{-1}-\frac{C}{(-1)}=-1\text{,}
\end{equation*}
and thus
\begin{equation*}
C=-(e^{-1}+1)\text{.}
\end{equation*}