Some problems are due to habits, like garbage build up or smoking, others can't be helped like mold and mildew because of exposed earth in basements.
Here is what I have discovered: there is a company named Alpine industries, I have one of their little machines that eliminates mold and mildew. It eats up smells too, whether they be diaper, pets, shoes, trash, due to water damage, etc. It oxidizes the smells. Now if you have a moisture problem you need to fix the problem (by sealing moisture out or changing the direction water flows around your house, or paint your basement walls, etc.). Check with an Alpine dealer, the units are great and do more than just fix odor problems. Hope I've been helpful! Christ's Peace, Bruce