For nearby stars we use parallax to estimate the distance. Snap a photograph of the sky, wait six months, then take another. The apparent shift in position, after deducting the actual shift, gives us an estimate of the distance as compared to far more distant background stars. One parsec corresponds to the distance at which the mean radius of the earth's orbit subtends an angle of one second of arc, and is equivalent to 3.26 light years.
This is how stellar distances are measured. What causes the enormous gulfs between stars are gravitational tides and the enormous empty space through which all these stars drift.
The distances to nearby stars are used by the parallax method. For the distance to stars that are farther away, a variety of methods is used; methods that usually rely on something like the typical or maximal brightness of a particular type of objects, and - for far-away galaxies - on the expansion of the Universe. For more details, I suggest the Wikipedia article on "Cosmic distance ladder".
Stellar parallax
Light years or parsecs
Distance is determined by measuring the length between the start and end point.For example, short distances can be measured in feet, yards or metres.Longer distances would be measured in miles or kilometres.
The distance between stars are much greater than distances between objects in our solar system
Planets and stars
Because of the large distance between satellites, distances from Earth to distant stars and planets can be determined more accurately (greater parallax). Also, on board cameras can better view objects on Earth in 3 dimensions.
Any distances between two points outside the solar system, or betweenanything inside the solar system and anything outside it, are.(With the exception of the distances now being estimated between exoplanetsand their respective host-stars.)
The stars.
For close-by stars, parallax can be used to gauge distances. But for the most remote stars observable, the distance is too great to use parallax. Those distances are determined using a variety of methods, depending on the type of star, the approximate distance scale, and other circumstances. Such methods would require a much greater theoretical understanding of the stars themselves as well as the structure of the cosmos at large scales.
Use "Astronomical UNit" or AU when discussing distances within the solar system. Use "light year" when talking about the distances between stars.
Usually such distances are measured either in light-years, or in parsecs.
epicentral distances