Let $Y \sim \operatorname{Gamma}(2,1)$ with PDF $$f_Y(y) = y e^{-y}, \quad y > 0.$$ Then $X = g(Y) = a e^{-Y}$ for a parameter $a > 0$ has PDF
$$f_X(x) = f_Y(g^{-1}(x)) \left|\frac{dg^{-1}}{dx}\right| = f_Y\left(-\log \frac{x}{a}\right) \frac{1}{x} = -\frac{x}{ax} \log \frac{x}{a} = \frac{1}{a} \log \frac{a}{x}, \quad 0 < x < a.$$
Consequently, we can generate realizations from $X$ by first generating a gamma random variable $Y$, then compute $X = ae^{-Y}$.
In turn, we generate realizations from $Y$ by simply computing pairs of IID exponential variates with mean $1$, and taking their sum. And the exponential variates can be generated using the usual inverse transform method of a uniform random variate.
The theorem used for the transformation (restated here for the appropriate random variables) is:
Let $Y$ have PDF $f_Y(y)$ and let $X = g(Y)$, where $g$ is a monotone function. Let $\mathcal X$ and $\mathcal Y$ be defined by $\mathcal Y = \{y : f_Y(y) > 0\}$, $\mathcal X = \{x : x = g(y) \text{ for some } y \in \mathcal Y\}$. Suppose that $f_Y(y)$ is continuous on $Y$ and that $g^{-1}(x)$ has a continuous derivative on $\mathcal X$. Then the PDF of $X$ is given by $$f_X(x) = \begin{cases} f_Y(g^{-1}(x)) \left|\frac{d}{dx}\left[g^{-1}(x)\right]\right|, & x \in \mathcal X \\ 0, & \text{otherwise}. \end{cases}$$