A transformer is employed to
Obtain a suitable dc voltage
Convert dc into ac
Obtain a suitable ac voltage
Convert ac into dc
A transformer is a device to convert alternating current at high voltage into low voltage and vice-versa.