The base layer is the first layer of protection. This is socks and underwear, but also includes long pants and technical shirts. These are usually thin layers that fit close to the skin. They do not have to be skin tight, but does not need to be loose. They need to be form-fitting to promote optimal moisture management as well as ease of layering over. Typically the long under pants are only worn in colder months, but the shirt is usually worn alone during the warmer months.
Some people will wear 2 pair of socks for backpacking. A very thin polypropylene sock and then a heavier-weight wool sock over this. However, some prefer to just wear the one sock, and this is usually a wool sock. Do not wear cotton socks. These will retain any moisture and will more than likely lead to painful blisters. Of course length of sock depends on user preference, but also on typr of shoe / boot worn and time of year or conditions expected.
Underwear also should not be cotton. Again, polypropylene is the best bet here. Also, some like to wear a boxer briefs to help reduce chaffing. Some prefer not to wear any at all. This again is personal preference.
Long under pants are more typically worn during the cold months. There are different weights (light, medium, and heavy or extreme) of long pants that are used accordingly to the conditions expected. Some hikers prefer to wear a pair of long under pants under a pair of shorts to hike in.
There are a few different materials that the technical shirts are made of. Most commonly is the polypropylene and wool. Also, the same as with the long under pants, there are different weights to many of the technical shirts as well. There are also long sleeve and short sleeve. Other than price, some things to think about when choosing these shirts are: odor-control, fit, hems, durability, weight, length, breathability, moisture management, and layering capabilities.