If a packet of flour, nuts, cereal or birdseed is seriously infested with mealworms, discard it immediately. (If you've just bought the infested product, go back to the shop where you bought it and ask for a refund.)
To guard against infestation, keep dry foodstuffs in tightly closed containers. It's best if these have clear lids because then if mealworms do hatch in them they can be seen without removing the lid.
If infested food is found in the kitchen cupboards, clear them out, vacuum and scrub them, and remove and replace shelf paper.