A dehumidifier removes moisture from the air, thus lowering the humidity. It does this by condensing water onto a cold surface. This is a principle that we have all experienced. When you have an ice cold drink on a hot day, you notice water collecting on the outside of the glass.
This is exactly how dehumidifiers work, with a fewer minor differences to improve the effectiveness. A fan is used to speed up the process. It blows warm air onto cold metal coils, and the resulting water drips into a bucket. The resulting cold air is then passed over warm coils to bring it back to room temperature. Air conditioners work in the same way, but they do not reheat the air before returning it to the room.