Step 3 : Fasten the unit and connect the wires
Install the new fan housing in the opening. It's often easier to first pull the wiring back into the unit's built-in electrical box. Reconnect the wires according to the manufacturer's instructions following like-colored wires - black to black, white to white and green or bare wire to ground wire.
Then permanently mount the unit in one of two ways: Use the extendable mounting brackets (if provided) and attach them to the joists from the attic, then crimp the guides that hold them to the housing. The other way is to work from below and fasten the unit directly to the ceiling joists through the holes or slots in the housing. In this case, discard the brackets so they won't rattle when the unit operates. With the housing securely in place, reinstall the fan motor and tighten all connections. If the unit has separate internal plugs for the fan and light, (they're usually color-coded for easy identification) connect them.