Cotton is a crafting material mostly used to create cute-themed objects. Basically, cotton can be received simply from completing requests however, to specifically farm for cotton you would have to host animals who prefer cute themes. They will occasionally gift you with cotton when you speak to them and they are more likely to reward you with cotton when they level up. Some animals like Bud who prefers Sporty themes will gift you cotton regularly when you speak to him. Sometimes he will also reward you with cotton whenever you level up your relationship with him or whenever you complete requests from him.
Received from Shovelstrike Quarry
The Shovelstrike Quarry is probably the best, worst way to gain specific crafting materials. It is the worst because you would have to wait for the Quarry to feature it as a reward which could take a while depending on the rotation for the day and its considered the best(aside from gaining them from animal rewards) because whenever it is featured as a reward at the Quarry, you will gain a large amount of it.