There are two reasons an animal might get into your chimney, it either decided to take shelter there, or it got trapped.
In the case of birds and squirrels, they most likely fell in and got stuck. Raccoons, on the other hand, tend to move in. Listen carefully to determine which is in your chimney. A trapped animal will panic and flap and scratch to get free. An animal that wants to be there will be quieter as it goes about its business.
In either case, don’t light the fire to get it out! That will only injure the animal. Instead, call Chimney Sweeps of America for professional animal removal.