I’ve recently seen maps of the world from different time periods and there were quite accurate. It got me wonder as to how they were made, did people literally sail around countries and draw how they saw the coast line? Or was much more complex than that? Thanks!
Mostly through surveying the land. The basic tool for this is the theodolite, which is a telescope that has a base that can be leveled accurately and that contains markings to read off the horizontal and vertical angle of a sighting, ideally with as great a precision as possible. Important secondary tools are a means of measuring distance such as a tape, cord, or a measuring wheel and a magnetic compass.
So, begin with a single point, put a fixed marker on that point and define that as your reference. Now, place your theodolite over that point, orient your theodolite using a compass so that the horizontal readings are compass headings. Now, pick a second point that you can sight through the theodolite, ideally something far away and either at the same elevation (which you can determine because of the vertical angle reading from the theodolite, which you have levelled) or which lies along a consistent slope. Then manually measure the distance to that point using a measuring rope or a wheel or what-have-you. Because you know the relative angle on a map from the first point to the second via the theodolite measurements and because you know the distance you can now position both points in a coordinate system or on a map. And now the world is your oyster.
Pick a third point, such as a distant mountain peak, for example. Take readings of bearing and elevation from the first and second reference points to the peak. Now you have two lines in 3 dimensional space which meet at the point of the mountain top. You can use the bearing readings to locate the coordinates of the mountain peak on the map and you can use the elevation readings to determine the height of the mountain through trigonometry. To map a country you just keep doing this until you've filled a whole landscape in with a series of triangles (some overlapping or not connected, of course) with theodolite measurements blanketing everywhere. The more measurements you have the more you can refine the map. While other measurements can be used to cross-check the data. However, this is the primary method of making accurate maps in the immediate pre-modern age. This is how the height of Mt. Everest was determined, for example.
There are also additional measurements you can do which you can cross check these measurements. For example, using a quadrant or sextant you can measure the height of the Sun and determine local latitude absolutely without reference to other geographic measurements (useful for determining the location of islands). Using a precise watch (a chronometer) you can perform various observations of the Sun or the stars to determine your absolute longitude as well.
Then there are naval measurements. A ship at sea will keep track of its heading (via compass measurement) and its speed, keeping a log of both at regular intervals (e.g. every hour) over a journey. There are lots of different ways to keep track of speed, the typical method in the age of sail would be to toss a board in the water that would float and be more or less unmoving along with the water it was in, then pay out a line as the boat moved away from it while measuring a set time with an hourglass. Other corrections, like the movement of ocean currents, would have to be estimated. Using these measurements a boat could estimate where it was based on where it had been in a known location and its recorded movements (by heading and speed) since, a technique called dead reckoning. These measurements are similar to surveying measurements because they give you a line with a distance and direction (the ship's journey as measured by dead reckoning) between two points (origin and destination). The track of the boat through the water might be a wandering pathway that goes this way and that but you can translate that into an equivalent single line "measurement" that goes from the start to the finish of the dead reckoning track, that you can then overlay onto a map with the start at the origin location. Using lots and lots of logs from multiple ships you can then determine the relative positions of many such points on a map, which can complement the data you collect from other methods.
The highly accurate maps from the 19th century, for example, are based on a truly mind-boggling amount of labor from surveyors taking zillions of theodolite measurements. For example, the "Great Trigonometrical Survey" refers to the survey of India by the British in 1800s which took something like seven decades to complete and employed hundreds of individuals at any given time. Today this kind of work is still done, but increasingly it's being folded in along with other ways of measuring the Earth such as GPS, photogrammetry from aerial/satellite imagery, lidar and radar (from planes and satellites), etc.