Let $(X,d)$ be a metric space, and let $A$ and $B$ be any (non-empty) subsets of $X$. Then we define the distance between $A$ and $B$ as follows:
$$D(A,B) \colon= \inf \left\{ \ d(a,b) \ \colon \ a \in A, \ b \in B \ \right\}.$$
Now since the set $$\left\{ \ d(a,b) \ \colon \ a \in A, \ b \in B \ \right\}$$ is a subset of $\mathbb{R}$ that is bounded below by $0$, it always has an infimum.
Now the question is whether this infimum is actually attained, that is, if there exist points $a_0 \in A$, $b_0 \in B$ such that
$$D(A,B) = d(a_0, b_0).$$
Let $X \colon= \mathbb{R}^2$ with the Euclidean metric, and let
$$A \colon= \left\{ \ (x,y) \in\mathbb{R}^2 \ \colon \ xy=1 \ \right\},$$
and
$$B \colon= \left\{ \ (x,y) \in \mathbb{R}^2 \ \colon \ xy=-1 \ \right\}.$$
Then the sets $A$ and $B$ are closed sets (because their complements are open), but there is no minimum distance between them. Look at the graphs of the functions $f, g \colon \mathbb{R} \setminus \{0\} \to \mathbb{R}$ defined by
$$f(x) \colon= \frac{1}{x} \ \mbox{ and } \ g(x) \colon= -\frac{1}{x} \ \mbox{ for all } \ x \in \mathbb{R}\setminus\{0\}.$$
These graphs are exactly the sets $A$ and $B$.
Let $(a_1, a_2) \in A$, $(b_1, b_2) \in B$. Then
$$a_1 a_2 = 1 \ \mbox{ and } \ b_1 b_2 = -1.$$
So, $a_1, a_2, b_1, b_2$ are all non-zero and
$$a_2 = {1 \over a_1} \ \mbox{ and } \ b_2 = -{1 \over b_1}.$$
Therefore,
$$
\begin{align}
d\left( (a_1, a_2), (b_1, b_2) \right) &= \sqrt{ (a_1-b_1)^2 + (a_2-b_2)^2} \\ &= \sqrt{ (a_1-b_1)^2 + \left( {1 \over a_1} + {1 \over b_1 } \right)^2}.
\end{align}
$$
So let's consider the function $F \colon \mathbb{R}^2 \setminus \{(0,0)\} \to \mathbb{R}$ defined by
$$F(x,y) \colon= (x-y)^2 + \left({1 \over x } + {1 \over y} \right)^2 \ \mbox{ for all } \ (x,y) \in \mathbb{R}^2 \setminus \{(0,0)\}. $$
Let's try to minimise this function. The minimum value, if any, is attained at the points $(x,y) \in \mathbb{R}^2 \setminus \{(0,0)\}$ where
$${\partial F \over \partial x } = 0 = {\partial F \over \partial y }.$$
Now I hope you can continue from here.