Along with regular deworming, here are some preventive measures:
Proper disposal of pet waste to limit environmental contamination.
Prompt removal and disposal of feces when walking dogs outside.
Avoidance of contact with potentially infected animals or their feces.
Regular cleaning and disinfection of living areas and bedding.