Carpets are made with absorbent fibre material that can truckle and hold onto smelly odours from the air, or more usually from things spilled on it and not cleaned up as it should be, especially food. Another bad odour that can stay in your carpet is odours from your pets. Another alternative is hiring a professional carpet cleaning company. This can be the most costly alternative, although if the odour remains after the cleaning, that company would have to come in and do it again at no more cost to you. When hiring a carpet cleaning company this problem should be addressed.