Store pantry foods in lidded containers to stop ants. Glass jars are good for items mice like. Plastic containers work too. Keeping everything sealed will deny ants food access.