The answer to 'how to replace ceiling fan' is to safely disconnect the old ceiling fan, install the new fan according to the manufacturer's instructions, and securely mount it to the electrical box. This process typically involves turning off power to the circuit, removing the old fan, connecting the new fan's wiring, and securing the new fan to the ceiling.
Replacing a ceiling fan is a common home maintenance task that most homeowners can do themselves, but it's important to take the necessary safety precautions and follow the steps carefully. If you're not comfortable working with electrical wiring, it's best to hire a licensed electrician to handle the job.