I always have trouble with them, how do I get rid of them?
The only "worm" that I have had attack both squash and cucumber fruit is the pickle worm. There are several caterpillar types that attack foliage, but these are easily controlled with Bt.
Here is a link that might be useful: Pickle worm
If the worms you are talking about are the squash vine borer then click the FAQ button in the sction shown above the Forum posts. If not the SVB then what types of worms are you having trouble with?