Place the denim in the washing machine. Add 1/2 cup of baking soda along with your preferred laundry detergent.
Launder the denim according to the care label. Denim needs to be washed in cold water to help prevent the dye from fading. Turn the denim inside out if possible and launder it separately from other fabrics.
Add 1 cup of white distilled vinegar to the rinse cycle. Continue laundering the denim.
Place the denim in the dryer. Tumble dry the denim on low. If you cannot place the denim in the dryer, hang it in a sunny location with plenty of air circulation.
Soak the denim in an equal amount of white distilled vinegar and cool water if the odor remains after you launder the denim. The diluted white vinegar will remove odors and will help protect the color of the denim.
Repeat the odor removal process, starting from Step 1, if the denim still smells.