They used a compass and stars and had a dedicated navigator for long trips over water. His job was to gauge the winds and give the pilot a heading to stear that will keep them on the desired track.
Early land based air navigation began with mail routes. They used fire barrells arranged in a line at stations along the route that pilots could spot maybe - hopefully - 50 miles away or more.