If you think your cat might have a lungworm infection, the best thing to do is to go to your vet. They can do a full physical examination, and check your cat over from nose to tail! Faecal testing is the most common way to look for a feline lungworm infection. If there is a risk your cat may have lungworm, your vet will prescribe a worming treatment suitable for feline lungworm, which should eliminate the worms, as well as providing any other treatment that might be necessary if your cat is showing more serious signs. Cats may also develop immunity against the worms themselves, although usually this is seen in cases with less developed clinical signs.
Although infection by lungworm has not been proven to be prevented by the deworming protocols available, if your cat has been diagnosed with lungworm it is very likely that they will be exposed to multiple types of parasite. If you are not already using parasite prevention on your cat routinely, your vet will discuss your options and the best way to give your cat the best protection you can.