Suppose that $A$ and $B$ are nonempty closed convex subsets of the Hilbert space $H$.
Case I: If $A$ or $B$ is bounded, I can prove that there exist $a\in A$ and $b\in B$ such that $$d(A,B) = d(a,b),$$ where $d(A,B) := \inf\{d(x,y)\mid x\in A,\, y\in B\}$.
Case II: If both $A$ and $B$ are unbounded and assume $\lim_{\|x\|,\|y\|\to\infty} d(x,y) = \infty$, how to prove the same result as in Case I?
The proof of Case I:
Without loss of generality, we can assume that $A$ is bounded. For any $n\geq 1$, there exists some $x_n\in A$ such that $$d(x_n, B) < d(A, B) + \frac1n.$$ Since $(x_n)$ is bounded, there exists some $a\in A$ such that $x_n\rightharpoonup a$ in the weak topology of $H$, i.e. $$\lim_{n\to\infty} \langle x_n, y\rangle = \langle a, y\rangle\quad \forall y\in H.$$
Since $$\begin{align} \|x_n - P_B(x_n)\|^2 & = \|x_n-a+a-P_B(a)+P_B(a)-P_B(x_n)\|^2 \\ & = \|a-P_B(a)\|^2 + \|x_n-a+P_B(a)-P_B(x_n)\|^2 \\ & \quad + 2\mathrm{Re}\langle a-P_B(a), x_n-a\rangle + 2\mathrm{Re}\langle a-P_B(a), P_B(a)-P_B(x_n)\rangle \\ & \geq \|a-P_B(a)\|^2 + 2\mathrm{Re}\langle a-P_B(a), x_n-a\rangle. \end{align}$$ We have \begin{align*} (d(A,B))^2 & \leq \|a-P_B(a)\|^2\leq\|x_n-P_B(x_n)\|^2 - 2\mathrm{Re}\langle a-P_B(a),x_n-a\rangle\\ & < \biggl(d(A,B)+\frac{1}{n}\biggr)^2 - 2\mathrm{Re}\langle a-P_B(a),x_n-a\rangle \\ & \quad \to (d(A,B))^2 \qquad \text{as } n\to\infty. \end{align*}
It follows that $d(a,b) = d(A,B)$ where $b = P_B(a)$.