In the simplest terms (baring no other constraints) you are looking for the Geometric Median, which is the point minimizing the sum of distances to all other points. A solution to this problem is less simple and is often estimated.
This demo from Wolfram shows an interesting interactive example using a few points. Notice here it is referred to as the Center of Mass (of n points). They also include a link to the code used to produce this demo.
This (from Wikipedia) should help you to distinguish the Geometric Median from the Center of Mass:
Despite the geometric median's being an easy-to-understand concept,
computing it poses a challenge. The centroid or center of mass,
defined similarly to the geometric median as minimizing the sum of the
squares of the distances to each point, can be found by a simple
formula — its coordinates are the averages of the coordinates of the
points — but no such formula is known for the geometric median, and it
has been shown that no explicit formula, nor an exact algorithm
involving only arithmetic operations and kth roots can exist in
general. Therefore only numerical or symbolic approximations to the
solution of this problem are possible under this model of
However, it is straightforward to calculate an
approximation to the geometric median using an iterative procedure in
which each step produces a more accurate approximation. Procedures of
this type can be derived from the fact that the sum of distances to
the sample points is a convex function, since the distance to each
sample point is convex and the sum of convex functions remains convex.
Therefore, procedures that decrease the sum of distances at each step
cannot get trapped in a local optimum.
I would recommend using the above search terms (Geometric Median, Center of Mass) on StackOverflow as there are several automated examples that may be of use to you.
If you have access to GIS software, a tool such as Near (Analysis) in ArcGIS could be used to solve this problem.