If $d(A,B)=\min\{ d(a,b): a\in A\text{ and }b\in B\}>0$ then $A\cup B$ is not connected.
We claim that the two sets are disjoint, suppose it is not we have $d(A,B)=0$
So now we have to say any union of two arbitrary disjoint sets is not connected
I am stuck here
So there exists $r>0$ with $d(a,b)>2r$ for all $a\in A$, $b\in B$. What can you say about the following unions of open balls of radius $r$? $$\bigcup_{a\in A}B_r(a)\qquad\text{and}\qquad \bigcup_{b\in B}B_r(b)$$