Cosmic distances are calculated using several methods. For nearby stars, astronomers use parallax, which is the apparent shift in a star's position as Earth orbits the Sun. For more distant stars and galaxies, they use standard candles, which are objects with known brightness, like certain types of supernovae or variable stars. The observed brightness of these objects can be used to calculate their distance.