Heartworm Preventative Medication: Heartworms are contracted through mosquito bites. The best way to reduce the risk of infection is to administer a safe heartworm preventive that kills immature worms before they cause damage. Treatment for heartworms is risky and expensive so it is important to use year-round preventative medication since heartworm disease is preventable. Puppies should begin on heartworm preventative by 6 months of age. Any dog older than 6 months should be tested prior to beginning heartworm preventative. Testing is required annually even if your dog has been on preventative.