To prevent decompression sickness, divers use specialized equipment such as decompression chambers and gas mixtures that help them safely ascend to the surface without experiencing any adverse effects. These devices allow the diver to gradually decrease the pressure on their bodies, allowing the nitrogen gas to be safely expelled without causing harm.