Heartworm (HW) infection is caused by a filarial (worm-like) organism, Dirofilaria immiti. The carriers are nearly 70 species of mosquitoes. The mosquitoes hosts the worm in it's larval stage, where it then may transmit it to it's wild or companion animal victim. Ferrets and dogs are highly susceptible; cats are somewhat resistant (but not entirely immune).
Long story short, the larvae incubates in the mammalian host - and present themselves in the pulmonary arteries, typically. The chambers of the heart become impaired, affecting overall function. Symptoms include weight loss, shortness of breath, weakness, respiratory dysfunction (including cough) and death, possibly.
Only your vet can diagnose heartworm. An antigen test, which is the most effective way to diagnose heartworm, is administered in your vet's office via a blood sample. Test results are usually quick. (Tests are done in-office in my experience.)
Treatment options can only be determined by your vet due to the each animals level of infection.
Thankfully, heartworm is preventable! It is important that your pet be tested each year for the disease and be prescribed heartworn preventative per your veterinarians' recommendations.