Bats do not usually want to be in your house with you. Once you set it free, it is very unlikely it will return to take up residency. If that is a concern, placing a bat house high up in a pine tree (usually a dark sheltered area on the north or east side of the property) will help.
To get the bat out, well first you have to find it, (best done at night when they are awake). Open the window from the top (if this is possible) they will tend to circle the top of a room when flying. A fish net works good to catch and then gently release the bat outdoors. Shining a flashlight directly on them will momentarily immobilize them to accomplish the netting of it. Wear work gloves in case you need to free it from the fish net. If you are squeamish about this approach, you can gently guide the bat toward the window by holding a broom up behind it a foot or so as it fly’s (assuming it is in motion) and guide it to the exit.
In many states bats are a protected species, so be gentle.
Good Luck !