First measure the size of you new fan.If replacing an existing fan remove old fan.Find ceiling joist by looking for nail pops or use stud finder.When ceiling joist is located, draw dimensions of new fan on ceiling with pencil,making sure you put the fastening side of the fan to the joist.Not all fans are square.
Cut out the hole in the ceiling with a keyhole saw.Remove the inside guts to the ceiling fan .If replacing an existing fan the electrical wire is already there.Adding a wire for a new installation. You must turn off power to the bathroom.Determine what size wire you must use by the number on the circuit breaker.20 amp breaker you would use a 12 gauge wire 12/2 with ground.A 15 amp breaker you would use a 14 gauge wire.
Fish wire through hole in the top plate of wall through the attic to switch box.You can get a double switch or if you have enough room you can add a new single pole switch,by replacing the single gang box with a two gang old work box.With the old work box you would remove existing switch box and replace it with the two gang old work box.Rewire configurations.
Wire the fan up to the new or old wire.hook up flex pipe or existing pipe to fan.Slide fan up through the hole and fasten it to the ceiling joist with screws or nails.Up in the attic attach exhaust pipe to soffit vent or ridge vent.Preferably use a roof cap vent.