It will probably evolve over time, but so far ships are navigated in space by a combination of celestial navigation (orientation by sighting on various stars & the subject planets with a precision instrument), onboard inertial navigation (which tracks the movement of the ship by finely recording all relative forces of reaction with precision motion sensors), and Earth based tracking using ground stations. Each of these systems cross check each other to assure accuracy.
Crystal