The infective larvae develop and survive in an environment of damp dirt, particularly sandy and loamy soil. They cannot survive in clay or muck. The main lines of precaution are those dictated by sanitary science:

Prevent skin/soil contact: do not walk barefoot
Do not defecate outside latrines, toilets etc.
Do not use human excrement or raw sewage as manure/fertilizer in agriculture
Deworm pet dogs — canine and feline hookworms rarely develop to adulthood in humans (Ancylostoma caninum, the common dog hookworm, occasionally develops into an adult to cause eosinophilic enteritis in people), but their invasive larvae can cause an itchy rash called cutaneous larva migrans.
Moxidectin has been released in the United States as part of Advantage Multi™ (imidacloprid + moxidectin) Topical Solution for dogs and cats. It utilizes moxidectin for control and prevention of roundworms, hookworms, heartworms, and whipworms.

In the late 1800s and early 1900s, many Mississippians were plagued by hookworms. They did not have indoor plumbing or proper sanitation facilities. As a result, hookworms, spread by fecal contamination of the environment, were very prevalent (as well as other diseases caused by lack of sanitation).