A rectifier is used to convert alternating current (AC) into direct current (DC), typically used in power supplies for electronic devices.