I can't eat garden broccoli unless I use dipel (AKA thuricide.) Walmart carries it now.
I generally apply it just before the broccoli begins to form heads, and then once or twice more as the rain washes it off.
Dipel also keeps worms out of cabbage, brussels sprouts, and cauliflower. I think you can also use it to keep earworms out of corn, but that is a little trickier, since the ear worms are inside the shucks. There is a different variety that works for potato bugs.
Salt water soaking is supposed to help eliminate worms, but I have found one too many little floating in the cooking liquid after soaking. I know it's not dangerous to eat them, but. . . . .ewww.