In my experience the material of the socks plays a role in how sweaty (wet) they feel and how smelly they get.
Our modern default material is cotton, but cotton clings on to moisture and stays wet for quite long compared to other options. Even worse are all artificial fibers like acrylic, nylon, polyester and any other poly* fibers. They quickly produce very unpleasant body odor. See some research results here.
Linen and viscose (aka rayon) fibers, on the other hand, have a wick effect and evaporate moisture quicker than cotton. In addition to that, they do have antibacterial properties that hinder the growth of odor-producing bacteria (see research here). Some sources claim that bamboo fibers (technically just viscose fibers but from a specific source) have superior antibacterial properties, but these claims were proven wrong by unbiased scientific research. But in the end, bamboo viscose is still viscose and performs better than cotton in avoiding sweat and odor.
As mentioned in another answer, wool also inhibits body odor, although it doesn't inhibit the growth of bacteria.
In summary: look for wool, viscose (aka rayon), linen or bamboo fiber socks to wear next to your skin. If you can only find thin socks, wear a second pair over the first one.
And the next tip is to wash your underwear hot (at around 60°F / 140°F) to kill the bacteria that are already in there. A hundred years ago it was common practice to boil your undies, but our modern society somehow thinks that 30°C / 85°F is enough to sanitize your laundry. On the contrary! This is the perfect temperature for bacteria to grow and thrive. The detergent removes the sweat and oil from your laundry, but the bacteria are still there and as soon as they touch your skin, they start producing odor again. There are special antibacterial detergents available, but they are a hazard for the environment and entirely unnecessary.