Chimneys require removal and then capping the chimney so they can not return. When they have entered a dwelling and are co-existing with the residents that pay the bills we remove them and repair their means of entry. This is not always as easy as it sounds. Bats like mice, do not need a gaping hole to enter a dwelling. A quarter of an inch is enough.
All structures are different, and exclusion methods vary with the structure.
There are some repellents on the market that work. Most of them contain Naphthalene or mothballs. If the roosting site is fairly new, removal of guano and placement of naphthalene will work.