This is also how sailors managed to navigate before GPS. As long as you know the date and time (of where you set off from) you can determine your longitude based on the position of the stars. Finding your latitude is easy, just see how far Polaris (the north star) is from the horizon… or Sigma Octanis if you’re in the superior hemisphere.