In order to get rid off the debuff "Ratty Apparel", you just have to give your colonists fresh clothes. When clothing is worn, its hit points deteriorate slowly until nothing is left of it. But even before that it is recommended to replace the clothings.
There are three debuffs on ratty apparel in RimWorld:
|Hit points of the clothing||Mood debuff|
|No clothing (0%)||-6|
The only exception to no clothing are colonists with the trait "nudist". These will receive a mood buff of +20 instead. To avoid debuffs for regular colonists, you can customize the outfits.
The outfits can be adjusted, which clothes may be worn. So it is possible, for example, to allow only clothes of legendary quality, or to forbid pants altogether.
To completely avoid the debuff on ratty apparel, you just have to set the top controller to 51% -100% hit points. With this, the colonists automatically replace clothing that falls below 51% hit points. It is important that there is enough fresh clothing stored that is allowed. Otherwise, the colonists will not wear anything.