Soak the basket in warm water and dish soap mixture after every use to avoid generating a bad odor in the air fryer. As simple as that.
Using a mixture of water and vinegar solution also works well to get rid of unpleasant smells from the fryer’s basket. I myself follow this tip and it always works. You should try it out too!