Female squash blossom
First time growers of the cucurbit family, which includes all those plants mentioned in the title, as well as other melons and gourds, often run into problems when the plant does not set fruit, one solution to this is through hand pollination.
Flowers on these plants are either male or female. The plants almost always produce male flowers first or more often, because it takes less energy to produce a male blossom than a female one, female ones usually come second, once the plant has grown larger and stored more energy. So often a new gardener will be alarmed that at first their plant is producing all these flowers, but never any fruit, not realizing they’re just male flowers. Not all plants have different sexed flowers. Some other species carry both parts in a single flower structure, other plants (such as kiwi) might on the whole be either male or female and every flower on the plant will be either always male or always female. But the squash family produces separate male and female flowers on the same vine.
You can very easily tell male flowers apart from female ones. In addition to the inner bits being different, male flowers arise from a skinny stem whereas on female flowers there is a miniature fruit just behind the flower. In the below pictures, which are of a yellow summer squash plant, you should be able to easily identify which flower is which.
Female squash blossom
Assuming you’re getting female flowers and not just male flowers, but rather than growing in side the little fruits on the female flowers seem to whither away, your problem is likely insufficient pollination. The fix for this is to hand pollinate your blossoms.
There are three ways to hand pollinate plants in this family. The first is to use a clean unused paintbrush. Simply wiggle it inside the male blossoms to pick up pollen, then wiggle it inside the female blossoms to deposit it. You can also use a Q-tip to achieve the same result. Finally, you can snip off the male flower from the vine, remove the petals to expose the anther, which is the little male bit with the pollen in the middle of the flower, and, well, simply stud that flower out by rubbing the anther inside against the stigmas (girl parts, pollen receptors) of your female flowers. Hand pollination is best done in the morning before it gets too hot.
Sometimes bees and other insects don’t do the trick 100%, and you need to resort to hand pollination. It may not be an option if you’re a farmer growing a whole field, but for the home gardener it works.
By the way, assuming you used the brush or Q-tip method, when you’re all done the plant no longer has a need for male blossoms, but they are excellent eaten. They are incredibly perishable, best eaten mere hours after picking, so can be hard to find at stores, however they are awesome stuffed, battered, and fried (try stuffing with spicy cheesy polenta, use a frosting piping bag to fill it), battered and fried empty, or just sauteed. Obviously cucumber blossoms aren’t big enough for this, but either winter or summer squash (which includes zucchini) work great. You can also eat the female blossoms, but most don’t because if you did you would never get any fruit from the vine.