Once you complete your knitting, the best way to combat shedding yarn is to wash the project (if it’s a washable yarn). Usually, hand washing in a gentle detergent, and drying the piece with the air-dry setting of your dryer for around 10 or 15 minutes will work.