How to find the distance if the points are above Earth's surface?
With the Earth's mean radius being 6,371 km, adding 10 km to that adds about 0.15% to the geometric distance at 10 km altitude. But since you have tagged it flight-planning, the difference is very small that you can neglect.

Since the atmosphere moves with the Earth, TAS ≈ GS in no wind is good enough for the altitudes where planes operate.

However, for a very accurate air distance, use a radius based on the altitude in the haversine formula. But if such high accuracy is needed, you also need to consider the exact Earth's radius at the point of measurement as it varies from 6,353 to 6,384 km. You also need to consider the true altitude as a height above the geodesic, and not just a pressure altitude.