Turn off the power to the circuit you'll be working on by flipping the circuit breaker. Never attempt to work on an a live electrical circuit.
Remove 1/2 inch of insulation from each of the black wires connected to the fan, using a set of wire strippers. Remove 1/2 inch of insulation from each of the input wires on the circuit you'll be connecting to, using a set of wire strippers.
Take one of the black wires and place its bare end next to and parallel with one of the input wires. Slip a wire nut over the bare wires and twist it to the right until it securely fastens onto the bare wires and covers them completely.
Take the other black wire and place the bare end next to and parallel with the other input wire. Slip a wire nut over the bare wires and twist it to the right until it securely fastens onto the bare wires and covers them completely.