How do I calculate the distance between the line joining the two points on a spherical surface and another point on same surface? I have illustrated my problem in the image below.

In the above illustration, the points A, B and X lies on a spherical surface, I need to find the distance between points (A,B) and X. I am not a mathematics guy. If possible please illustrate me the solution as non-mathematics guys could understand. Thanks.
Assuming you mean the geodesic line $AB$.
Hint: Calculate the angle $\theta =\angle XCP$ where $P$ is a point on the line and $C$ is the center of the sphere. For instance with $\cos \theta =\frac{\vec{CX}\cdot \vec{CP}}{|\vec{CX}|\cdot |\vec{CP}|}=\frac{\vec{CX}\cdot \vec{CP}}{r^2}$, where $r$ is the length of the sphere's radius and $\vec{CX}, \vec{CP}$ are vectors in $\mathbb{R}^3$. This angle is proportional to the geodesic distance between $P$ and $X$.
What you have to do then, is to find the point $P$ for which the angle is smallest.