Consider a metric space $(X, d)$ and $A \subset X$ and $K \subset X $. Suppose $K$ is compact. Consider $d(A, K) = \inf_{a \in A, k \in K} d(a, k)$
There exist sequences $(a_n \in A)_{n \in \mathbb{N}}$ and $(k_n \in K)_{n \in \mathbb{N}}$ such that $d(a_n, k_n) \to \inf_{a \in A, k \in K} d(a, k) $. Since $K$ is compact, it is closed so that $k_n \to k_0 \in K$. Then
$$d(a_n, k_0) \to \inf_{a \in A, k \in K} d(a, k).$$
Does this imply $\inf_{a \in A, k \in K} d(a, k) = \inf_{a \in A} d(a, k_0)$? If so, how?
The answer to your question is "no", and counterexamples abound.
Let $A = (-\infty, -2) \cup (2, \infty)$ and $K = \{\pm 1\}$. Observe that $d(A,K) = 1$. For each $n \in \mathbb{N}$, define $$ a_n := (-1)^n \left( 2 + \frac{1}{n} \right), \qquad k_n = (-1)^n. $$ We have $d(a_n,k_n) \to 1$, as desired, but $(k_n)$ is not a convergent sequence.
Let $$ A = \{ z \in \mathbb{C} : d(z,0) = |z| < 1 \}, \quad\text{and}\qquad K = \{ x \in \mathbb{C} : d(z,0) = |z| = 1\}. $$ Here, $d(A,K) = 0$. Define $$ a_n = \left(1-\frac{1}{n}\right) \exp(in), \qquad\text{and}\qquad k_n = \exp(in). $$ Then $$ d(a_n, k_n) = \left| a_n - k_n \right| = \left| \frac{1}{n} \exp(in) \right| = \frac{1}{n} \to 0 = d(A,K). $$ Again, $(k_n)$ is not convergent. Indeed, $(k_n)$ is not even periodic—we have $k_m \ne k_m$ for all natural numbers $m$ and $n$.
In order to play the game that is played in the question, we should think along slightly different lines. The goal, it seems, is to find a point $k_0 \in K$ such that $$ d(A,K) = \inf_{a\in A} d(a,k_0). $$ By definition of the infimum, if $$ D = d(A,K) = \inf_{(a,k)\in A\times K} d(a,k), $$ there is a sequence $( (a_n,k_n) )_{n\in\mathbb{N}}$ such that $ d(a_n, k_n) = D$. Because $K$ is a compact subset of our metric space $(X,d)$, it has the Bolzano-Weirstrass property, i.e. every sequence in $K$ has a convergent subsequence. Let $(k_{n_j})_{j\in\mathbb{N}}$ be this subsequence, and suppose that $k_{n_j} = k_0$. Then $$ D = \lim_{j\to \infty} d(a_{n_j}, k_{n_j}) = \lim_{j\to \infty} d(a_{n_j}, k_0) = \inf_{a\in A} d(a,k_0) \ge \inf_{(a,k)\in A\times K} d(a,k) = d(A,K) = D. $$ I am sweeping some details under the rug, so check that you understand each equality and inequality above. In any event, the important bit is that we have $D$ on both sides, so the inequality must be an equality. Therefore $$ d(A,K) = \inf_{a\in A} d(a,k_0). $$ In other words, if $K$ is compact, then we can find a point $k_0 \in K$ such that $d(A,K) = \inf_{a\in A} d(a,k_0)$. However, this point $k_0$ needn't be unique, and we have no guarantee that if $d(a_n,k_n) \to d(A,K)$ then $k_n \to k_0$.