The density function of $X$ is $\lambda e^{-\lambda x}$ (for $x \ge 0$), and $0$ elsewhere. There is a similar expression for the density function of $Y$. By independence, the joint density function of $X$ and $Y$ is
$$\lambda^2 e^{-\lambda (x+y)}$$
in the first quadrant, and $0$ elsewhere.
Let $Z=|Y-X|$. Let us first attack the problem of Z = Y-X and then the Z = X-Y will be the same result as X and Y are both exponentially ditributed with same $\lambda$. We want to find the density function of $Z$. First we will find the cumulative distribution function $F_Z(z)$ of $Z$, that is, the probability that $Z\le z$.
Consider $z$ fixed and positive, and draw the line $y-x=z$. We want to find the probability that the ordered pair $(X,Y)$ ends up below that line or on it. The only relevant region is in the first quadrant. So let $D$ be the part of the first quadrant that lies below or on the line $y=x+z$. Then
$$P(Z \le z)=\iint_D \lambda^2e^{-\lambda (x+y)}dx\,dy.$$
We will evaluate this integral, by using an iterated integral. First we will integrate with respect to $y$, and then with respect to $x$. Note that $y$ travels from $0$ to $x+z$, and then $x$ travels from $0$ to infinity. Thus
$$P(Z\le x)=\int_0^\infty \lambda e^{-\lambda x}\left(\int_{y=0}^{x+z} \lambda e^{-\lambda y}\,dy\right)dx.$$
The inner integral turns out to be $1-e^{-\lambda(x+z)}$. So now we need to find
$$\int_0^\infty \left(\lambda e^{-\lambda x}-\lambda e^{-\lambda z} e^{-(2\lambda)x}\right)dx.$$
We end up with
$$P(Z \le z)=1-\frac{1}{2}e^{-\lambda z}.$$
for $|Z| = |X-Y|$
Then $P(|Z|<z) = P(Z\lt z) - P(Z\lt -z) = P(Y-X \lt z) - P(-Z\gt z)\tag 1$
$ = P(Y-X\lt z) - P(X-Y\gt z) $
But $P(X-Y\gt z) = 1- P(X-Y\lt z) $
Again $P(X-Y\lt z) = 1-\frac{1}{2}e^{-\lambda z}$
Hence $P(X-Y\gt z) = 1-1+\frac{1}{2}e^{-\lambda z} = \frac{1}{2}e^{-\lambda z}$
Going back to the $(1)$
$P(|Z|<z) = 1-\frac{1}{2}e^{-\lambda z}-\frac{1}{2}e^{-\lambda z} = 1-e^{-\lambda z}$
In other words,
$P(-z\lt Z \lt z) = 2P(Z\lt z)-1$
$P(|Z|\le z) = 2 -e^{-\lambda z}-1 = 1-e^{-\lambda z}$
For the density function $f_{|Z|}(z)$ of $|Z|$, differentiate the cumulative distribution function. We get
$$f_{|Z|}(z)=\lambda e^{-\lambda z} \quad\text{for $z \ge 0$.}$$ which is nothing but $Expo(\lambda)$