Oh, how do you treat for those bugs? Any special powder, spray or is there nothing to fix it now that it is done? I hope not, they are such beautiful flowers to lose them.
I'll assume that your cosmos are located outside. Spider mites are known to attack cosmos, and will turn the leaves yellow. Whiteflies are also pretty common.
I'd try an insecticidal soap to control these bugs. These soaps are very safe and fairly effective. You can buy the soap "ready-to-use" at most garden supply shops, or make your own by mixing 1-2 tablespoons of liquid soap with a gallon of water. Spray your plants, being sure to cover all areas, every week until the bugs are gone.
If the soap doesn't work you could then try one or more of the chemical pesticides that have spider mites and whiteflies listed on the label.