Mothballs contain chemicals that repel moths, but they are toxic and emit strong odors. It's best to opt for safer alternatives like natural repellents or traps.