One way to do this is to use a cup and a thin piece of cardboard that covers the cup’s opening. First, wait for the bee to land on a smooth surface. Bees will usually fly around to various spots, so it will eventually land in a suitable place. If it’s taking too long, some gentle shooing might get it out of a corner or wherever it’s hiding. Once it’s on a smooth surface (such as a wall or a table) you can cover it with the cup. Next, gently slide the piece of cardboard under the cup until the bee is trapped between the cardboard and the cup.
Now that the bee is trapped, the next step is to take it outside and let it go. Be sure to hold the cardboard firmly to the cup as you make your way to the door. You will probably need both hands to keep the bee trapped, so it will be helpful if your door has a push handle you can use to open it. If not, you may need some help getting the door open. Once you’re outside, turn the cup opening away from you, remove the cardboard, and let the bee fly away. If it doesn’t fly away, try to swing the cup in a fast arc so the centripetal force will get it out of the cup. Then it will fly away.