You need a transformer when you want to convert the voltage of an electrical device to match the voltage of the power supply available in your location.
In most cases, this involves a lamp that operates on 12V.
When using a transformer, it is essential to choose the right type and capacity to match the voltage and pore requirements of your lamps to avoid any potential damage or malfunction.
In order to to make this work, the transformer will switch the main current from 220 - 240V to 12V. This accounts for traditional lights as well as LEDs.