Mildew thrives in moist and damp environments. In order to rid your closet of mildew and its unpleasant musty smell, therefore, you need to reduce humidity and moisture in the air. If you have a walk-in closet, installing a large window that allows air to circulate would help reduce humidity. For smaller reach-in closets, on the other hand, an exhaust fan can help. Allow coats, shoes, or other clothing that are damp to dry before putting them back in the closet.
Make sure that your closet is clean. Mildew does not survive if it does not have anything to feed on. Be sure that you do not put anything greasy or dirty inside your closet as mildew can thrive on them.
If you already have a mildew attack, you can get rid of them by cleaning the walls and shelves of your closet with a cleaning solution made of bleach and hot water at a ratio of 1 cup to 1 gallon.
First you will need to remove everything inside you closet. If your clothes already smell musty, spray them with a fabric spray, preferably floral. If possible, hang your clothes to get them aired.
Put on a pair of rubber gloves and mix your bleach and hot water solution. Use it to scrub every single surface inside your closet. This should kill the mildew. Bleach can smell strong, so you may also want to wear a mask.
To remove the bleach smell, use hot water to wipe every surface you applied with your solution. If you want, you can add drops of your favorite essential oil to facilitate the removal of the strong odor of the bleach.
Although it may be difficult to totally prevent the recurrence of mildew in your closet, placing jars, or boxes, or net-like pouches containing baking soda in every corner can prevent your closets from smelling musty. Also, you can stuff dryer sheets into your clothes’ pockets or shoes.