I get Frontline or similar from Costco.
Recently marked down $15 or $20 for the 8-pack. Maybe $65 for the 8 tubes, so full spring/summer/fall coverage (8 months)
I also skip the expensive HeartGuard tablets, that are stupid expensive.
You can get the same ivermectin sheep drench pint for about $30 (before Covid, at least), and use a small syringe to add it to food in the proper mg/kg dose. My dog gets 0.5cc/month.
Learned this from a vet-tech, who had a farm w/ other animals she treated, and so long as you properly dose (e.g. don't be off by a factor of 10), the sheep drench stuff is the same medicine. (definitely DO use HeartGuard the first year with your dog, to ensure they do not have an allergy to the ivermectin medicine, as there are other heartworm options).
One 16oz container of the ivermectin is more than enough to treat my dog his entire life here...