Unplug the clothes dryer from its electrical outlet. Pull the dryer away from the wall so the duct is revealed and easily accessible. Be cautious when moving the dryer if it is gas powered because kinking or detaching the gas line is dangerous.
Detach the accordion-style duct from the output coupling on the dryer's main body and from where it attaches to the exhaust output on the wall. Most accordion-style ducts are attached via a semicircular clamp with a screw-type tightening agent. Loosen the screw, and carefully pull the duct free.
Shine a flashlight into the output opening on the back of the dryer. Look for large clumps of lint. Pull out the lint, and discard it. Carefully clean inside the output opening with a large, foam-tipped bottle brush. Vacuum clean inside the output using a hose-type attachment on a vacuum cleaner.
Clean the exhaust output in the wall. It probably is filled with compacted lint. Pull out large pieces of lint, and then brush the wall exhaust output's interior with the foam-tipped bottle brush. Vacuum inside the exhaust output in the wall to extract remaining lint.
Position the new duct on the output coupling on the back of the dryer. Place a spirit level along the top edge of the duct to ensure the duct has a slight downward slope. Secure the duct around the output coupling using foil duct tape or a circular clamp.
Attach the other end of the dryer duct to the exhaust output in the wall using foil duct tape or a circular clamp. Carefully push the dryer back into position. Plug the dryer into its electrical outlet, and turn on the appliance to test the new duct work.
Go outdoors to where the exhaust releases. Place your hand beneath the exhaust output. Feel for warm air, which indicates the new duct was installed successfully and functions properly.