The warning about cotton only applies in certain situations. Like many things, it has been over-generalised. Cotton is fine in hot or warm weather. Look at what people in the Middle East wear-cotton.

In cooler or wet weather, that is when cotton should be avoided-when it gets wet, it stays wet and is a poor insulator. Fleece and wool work well, along with synthetic shells of one kind of another. I have Marmot Precip rain pants I wear in winter. I use Capilene for my base layer and have both fleece and a pair of synthetic insulated pants for warmth.

Some people wear wool for both base layer and insulation, things like Merino wool and surplus military wool pants.

In extremely cold weather (below freezing), cotton works fine as your outer windproof layer over wool or synthetic insulators.
_________________________
Don't get me started, you know how I get.