When you say you want to know where you are, you need two pieces of information: north-south (latitude) and east-west (longitude). Latitude is pretty easy to figure out because it's related to the position of the sun in the sky, but longitude is a bit trickier. Longitude is all about time, and it has to do with figuring out how far east or west you are compared to a reference point.
Let's imagine that you are playing a game of "pirate treasure hunt" and you need to find a secret island in the middle of the ocean. To do this, you need to know where you are. One way to do this is to use the stars.
Imagine you have a friend who is standing on the secret island. At midnight, your friend looks up at the sky and sees the North Star directly above him. You also look up at the North Star and measure the angle between the horizon and the star.
Now you know the angle between you and the secret island! If you have a way to measure the exact time you saw the angle, you can use math to figure out how far east or west you are. (The time is important because the stars move across the sky over time, so you need to know exactly when you took your measurement.)
Of course, this is a very simplified explanation, and in reality, figuring out your longitude is much more complicated. But the basic idea is that you use the stars and the time to figure out where you are in east-west terms, and this process is called longitude determination.