Sextant.
Using sextant, precise clock (chronometer), tables or calculator of solar declination, and calculation of Horizon Dip
you can determine you exact position (latitude and longitude).
If you are not at sea you will also use an Artificial Horizon.
At night in Northern hemisphere you measure altitude of Polaris for altitude and Big Dipper or some other well known (and available) star for longitude,
in Southern hemisphere Sigma Octantis is pretty faint, so you measure elevation and azimuth of Crux (Southern Cross), visible from January to October.
The more expirienced the navigator is, the easier they find useful star.
Recently much easier way is to use GPS receiver, but it is recommended (required) to know marine navigation with or without it.