The proof with some comments: It's enough to prove is that any open ball is open set in a metric space, i.e., for every $\epsilon>0$ and every $x\in X$, given an $y \in B^{X}_{\epsilon}(x)$ there exist some $\delta>0$, $$B^{X}_{\delta}(y) \subset B^{X}_{\epsilon}(x),\tag{*}$$ since you can take the intersection by $Y$ in both sides without changing the $\subset$ sign. Why this? Because, for every $\epsilon>0$ and every $x\in X$, given an $y \in B^{X}_{\epsilon}(x)$, taking intersection in both sides of $(*)$ yields that $$B^{Y}_{\delta}(y) = Y \cap B^{X}_{\delta}(y) \subset B^{X}_{\epsilon}(x) \cap Y. $$
Now, Let us denote the distance between two points by $d(x,y) = \|x-y\|$ by simplicity. Let us start the proof of (*). Let $x \in X$, $r>0$, and $y \in B^{X}_{\epsilon}(x).$ Since $y \in B^{X}_{\epsilon}(x)$, We have that $\|y-x\|<\epsilon$. Hence, $$0 < \epsilon - \|y-x\|.$$ This way, let $\delta = \epsilon - \|y-x\|.$ Given an arbitrary $z \in B^{X}_{\delta}(y),$ we have that $$
\|z-x\| \leq \|z-y\| + \|y-x\| < \delta + \|y-x\| = \epsilon.
$$ Hence, $z \in B^{X}_{\epsilon}(x).$ This means that $ B^{X}_{\delta}(y) \subset B^{X}_{\epsilon}(x),$ since every $z \in B^{X}_{\delta}(y)$ is in $B^{X}_{\epsilon}(x)$ as well.
You can understand this result as it saying that the distance between $X$ and $D$ is the sum of the distances between $X$ and $Y$ summed with the distance of $Y$ and $D$, since the radius of the circumference centered at $Y$ is actually the distance of $Y$ and $D$. Here, $D$ is the point that intersects the prolonged segment of $X$ and $Y$ with the boundary of the circle.
