Refraction plays a key role in celestial navigation because starlight coming in from the vacuum of outer space bends when it enters the atmosphere. The speed of light is slower in air, so the light bends (refracts), and as a result all the stars we see are actually not quite as high as they appear. We then apply a refraction correction to get them back to the right angle.
It is easy to see this effect in a bathroom sink by adjusting your sight angle to just not see the drain, then turn on the water and fill the sink, as shown below.
You are seeing the light bend toward you as it leaves the water surface. Then let the water run out and the drain goes away. Seems a nice way to demonstrate this effect.
Below is a schematic illustrating how this takes place, but as always with some hand waving needed to skip over more fundamental issues. We think of light as a wave, with the lines AB being a wave front. A fundamental point is light travels faster in air than in water.
When the A1 side of the wave hits the surface and enters the air, the B1 side is still under water. The A1 side starts to move faster now than the B1 side. So by the time B1 reaches B2, A1 has traveled quite a bit farther up to A2, and thus the wave front bends at the surface.
This simple picture shows why the angle you look at the drain (or star) makes a big difference. Look straight down at the drain (straight up to a star) and of course you do not see any change. Light will always bend away from the surface entering into the faster medium