Here's a great step-by-step look at a trap-out, from a job that Kirk and Sebastian did today. In this example, the bees are living in the wall of a house.
Step 1: Seal all the available bee entrances/exits (except for a single small one) with caulk.
Step 2: Install a one-way bee escape (the bees can get out, but not back in) over the remaining hole leading to the hive.
Step 3: Install a bracket to hold a nuc box.
Step 4: Place the nuc box with the entrance as close as possible to the bee escape. This nuc box contains brood, pollen, bees, and a queen. The bees from the wall hive, unable to return home, will join the nuc box hive. The nuc box population can grow fast—it can sometimes take several nuc boxes to collect all the bees from a trap-out hive.
Here's Kirk's play-by-play:
Here's another trap-out in action: