The short answer
In navigation, “sailing” usually means how a ship works out where it is and where it is going. Traditional ship navigation is often grouped into a few types: piloting near land, dead reckoning, celestial navigation and, more recently, electronic navigation. Each uses different information, and experienced navigators often combine them so that one can check another.
Piloting near land
Piloting means navigating close to land or in confined water. The navigator fixes the ship’s position by taking bearings on landmarks, lighthouses and buoys, and by checking depth soundings against the chart. Where two or more bearings cross on the chart, the ship has a fix. Learning what position fixing in navigation means is a good first step if you want to see how this works.
Dead reckoning
Dead reckoning works out a position from a known starting point, a course, a speed and the time elapsed. Navigators adjust the result for wind and current. The answer is an estimated position, not a confirmed one, and it drifts the longer it runs without a check from another method. The dead reckoning navigation technique is still taught because it works when other aids fail.
Celestial navigation
Celestial navigation uses the sun, the moon, the planets and the stars. The navigator measures the angle between a celestial body and the horizon with a sextant, records the exact time, and uses tables or calculations to turn the angle into a line on the chart. Two or more of these lines give a fix. It depends on clear skies and accurate timing, so it is usually used alongside other methods. For the mechanics, see sextant navigation how it works.
Electronic navigation
Modern ships use GPS, radar and electronic chart displays. These systems can give a position quickly and accurately. They still depend on power and signals, which is why many navigators keep the older methods as backups.
Points of sail: a different meaning of sailing
Sailors also use the word “sailing” to describe how a boat is sailed relative to the wind. The main points of sail are close-hauled, beam reach, broad reach and running. These describe steering and trim, not how the ship finds its position. If your question is about navigation, they are a separate topic.
How the methods fit together
Ships near the coast usually rely on piloting. Out of sight of land, navigators use dead reckoning between fixes, and celestial navigation when the sky allows. Electronic systems now supply most positions, but the older methods remain useful for checking those positions and for backup if the electronics fail.