Squash cross pollinate readily with other squashes of the same variety. They are insect pollinated so the insects are flying quite long distances. First thing is to know which variety of squash you are growing and what it will cross with.
You will also need to know what your neighbours are growing!
Next step is to identify the male and female flowers.
Female squash flower with little bulge of future squash. This one is pegged to keep away the pollinators.
Male flower -straight stem, no bulge.
Close the female flower with peg or bag. Wait till you have a male and female flower open at the same time.
Cut off the male flower and put it onto the female so the anthers meet the stamens.
Or you can isolate the anthers….
Then apply the pollen from the anthers to the stamens.
When the flower withers you can remove the bag but mark this squash with a coloured ribbon so you can be sure to identify it as the one you hand pollinated.