Clean, and then put it under the sun
Wash and exposure in the sun for one day
if the carpet is detachable, put it outside under the sun, if not, spray some freshener.
It is recommended that the carpet be washed with the washing liquid, and then exposure to air dry.