Cotton has been used to make fabric for thousands of years. While cotton used to be picked by hand, nowadays there are huge machines to plant the cotton, pick the cotton, gin the cotton and finally to turn that cotton into fabric. There are a lot of steps to this process, and it is only when cotton is planted and has grown up so that the fluffy cotton boles are ready for harvest that a lot of the hard work begins.
Once the cotton has grown into a full plant, identifiable by the fluffy cotton boles on it, then it's time for the harvest to begin. Large machines (whether stripper harvesters, which roll entire boles into the hopper, or spindle pickers, which snag on the cotton and pull it away from the plant) are used to collect all of the cotton in large swathes. They also collect a lot of unwanted plant debris, though, so once the cotton is harvested there's still plenty of work to be done.
Ginning is the process of separating the pure cotton material from the less pure seed that is still inside of the harvested cotton. Often located nearby the harvest site, cotton gins are huge machines that will use a combination of circular saws and grate filters to pull all of the cotton through to one end, while filtering out the unwanted seeds and plant matter.
Once the cleaned cotton is ready to be turned into fabric, it's put through the yarn process. Huge machines that can process up to 45.4 Kilogram of cotton per hour take the fluffy cotton lint and twist it, turn it and draw it out into a yarn. These machines spin the yarn until it has a proper thread count, which gives it a proper thickness.
In order to turn the cotton yarn into fabric, it has to be woven. Weaving is the process of taking cotton yarn and interlacing it in a horizontal (warp) and vertical (weave) pattern so that the yarn turns into what we know as cloth. Huge, mechanised looms can produce reams of cotton fabric using relatively the same methods as ancient weavers with wooden looms could.
Lastly, cotton fabric is dyed. This isn't always done, especially if the cotton remains white, but if the cotton fabric is supposed to be a different colour then it will be treated with dyes to alter its appearance. Dyes also can be used on yarn that will then make a pattern when woven into cotton cloth, but when the dyeing process occurs is a matter that's left up to the manufacturer.