Getting trapped in a house must be terrifying for a bird. In daylight, open the room’s curtains and windows and move away. The bird will normally go for the light and escape. At night in the dark, most birds will roost quietly. If you can, pick it up gently and put it into a box from which you can release it in daylight.