The most precise way to measure the distance of a star is by parallax, measuring the angles to the star from two points in the Earth's orbit that are separated by two Astronomical Units (AU) six months apart. The distance to the star can be calculated from the tiny difference in angles.
Astronomers have been inventing more and more precise techniques for measuring smaller and smaller angles over the last few centuries. And they will continue to do so for all the decades, centuries, or millennia it will take to invent spaceships capable of travelling at almost the speed of light.
So when a space ship starts for a distant star, it will know fairly exactly how far away it was when the light reaching Earth at the time was emitted. And thus they will know fairly exactly how long that light was emitted and how long a time there has been for the relative positions of the two stars to change.
In shooting there is technique called "leading the target", not aiming in the present direction to the target, but to where the target will be when the bullet or cannonshell arrives.
By noting the shift in spectral lines in the spectrum of the star, astronomers measure how fast the star is getting closer to or farther from the Earth.
By measuring changes in the direction to the star over time, astronomers will know how fast the star will be travelling sideways compared to Earth.
And computer programs can easily calculate the past and future positions of stars compared to Earth, once enough data has been secured.
Here is a link to a table of calculated past and future close passes between the Sun and other stars within a few million years of the present time.
And if a future society has spaceships which can travel almost as fast as light, they will send manned or unmanned observatories outside of he solar system to make parallax observations using a much wider baseline than the Earth's orbit, which has a maximum width of 2 AU.
If a star is observed from two positions, each position 1 light year to the side of the line between Earth and the star, the two positions will be 63,241.077 times as many AU apart as in Earth based observations, so parallaxes taken with equally precise techniques would result in distances 63,2141.077 times as precise.
If a star is observed from two positions, each position 1 parsec to the side of the line between Earth and the star, the two positions will be 648,000 times as many AU apart as in Earth based observations, so parallaxes taken with equally precise techniques would result in distances 206,264.81 times as precise.
Thus it will be simple to aim the spaceship ahead of the star's current direction so that the spaceship will arrive at the future position of the star instead of the present position of the star.
Furthermore, the velocity of a star is likely to be less than 1,000 kilometers per second relative to the Sun. Suppose the voyage takes 1,000 years. By definition, a light year is the distance travelled by light in 365.25 Earth days, so there are 31,557,600 light seconds in a light years. Thus at 1,000 kilometers per second, the star would move 31,557,600,000 kilometers in one year, or 0.00333564 of a light year. In 1,000 years the star would move at most 3.335640952 of a light year. If the starship has the ability to accelerate to almost the speed of light and then decelerate again, the ability to travel three more light years wouldn't be much of a problem, even if no adjustments were made for the velocity of the star before leaving Earth.
In a much shorter voyage to star much nearer Earth, and travelling much slower relative to the Sun, the position error would be much smaller.
And of course the course calculations for the voyage would take the future movements of the star into account, as I wrote above, instead of pointing the ship at the present position of the star.
Furthermore the starship should be able to see the target star for most or all of the journey, and account for various relativistic effects to keep track of its position. Thus they should be able to make course corrections when and if needed.