Bats are huge consumers of flying insects, so trapping or excluding them from a home is preferable to killing them. The trick is to seal the openings the bats use to enter the home. A fine mesh can temporarily seal openings.
Bats can move through a space with a width of three-eighths of an inch.
You can locate entrance areas by watching where bats exit the building at dark. You can confirm locations if you see a brown staining around these exits. Once bats leave at night, seal the cracks with caulking, steel wool, flashing, wood or cement. Once a hole is sealed, bats won't chew or pry it open again. If you are concerned that you might be trapping bats inside by sealing the opening, use fine wire mesh as a one-way exclusion system.