It depends on the cause of the smell. If it is a sour smell, chances are that the soap wasn't rinsed out completely. I always run my laundry through one more rinse cycle prior to drying. If it is a musty smell, and you always take your laundry out immediately after the wash is finished, your washer may need cleaning (yes, that's what I said, lol). Washer cleaners are located in the same aisle as the laundry detergent, or you can use CLR or IronOut as I do. If it is a dirty smell, you may be overloading your washer, keeping the laundry from agitating freely in the detergent/ water mixture and the rinse water. Never "pack" clothes in your washer, and never go above the top layer of "holes" in the drum for top loading washers. If you have a HE washer, you may need to run special cleaner for HE machines through it to get rid of any odor. If it is simply body odor or other odors that are difficult to remove from laundry, I use Tide with Febreze (I farm, so I KNOW stinky clothes!) and add a cup of white vinegar to the next-to-last rinse.
Run a bleach cycle, maybe needed a few times. Then run just a cycle with water only. You should be good to go. Also if you leave the washing machine door open after you have finished laundry, it does help I do it myself : )
vinegar but just a cap full cuz is strong. my ex husband works on a turkey farm and his clothes stank and a friend told me about this and it worked. just add it to the washer before you add your clothes.
if you are talking about that smell that is left on sheets, pillows, and pillow cases then try shampoo or bodywash. they are made to remove the 'greasy' residual smell that just wont wash out and that we humans tend to leave forever in our bedding and even clothes. lemon juice removes it too. good luck