Always turn off the power to the fan at the circuit breaker before attempting any electrical work. If you're unsure, consult a qualified electrician.