Garlic can stay in your lungs for 24 to 48 hours after you eat it. Keeping that in mind, there may not be a foolproof way to get rid of the odor. Chewing gum only slightly masks the odor. Eating mixed vegetables or cheddar cheese works a little better. However, simply brushing your teeth seems to be the best cure.