Two coils are wound on the same iron ring. AC in the first coil, the primary, makes a magnetic flux in the ring that grows, shrinks and reverses 50 or 60 times a second. The iron guides almost all of that flux through the second coil, the secondary, so every turn of both coils sees the same changing flux and, by Faraday's law, has the same voltage induced across it. Count the turns and you have the voltages: a secondary with half as many turns as the primary gives half the voltage.
For example, a primary with 1000 turns on 240 V mains has 0.24 V per turn. A secondary with 50 turns gives 50×0.24=12 V. If a 12 V lamp on the secondary draws 2.0 A, that is 24 W, and the primary must supply the same 24 W from 240 V, so it carries only 0.10 A. The voltage went down 20 times; the current went up 20 times.
A transformer cannot work on DC. A steady current makes a steady flux, and a steady flux induces nothing, so a transformer connected to a car battery gives no output (and its primary may overheat). It also cannot create power: real transformers lose a few percent as heat, so the output power is slightly less than the input. If a problem has a single coil with a changing flux, that is plain Faraday's law; a transformer always has two coils linked by one changing flux.
Think of it like this. A transformer is a gearbox for electricity. A low bicycle gear turns fast, light pedalling into a slow, forceful turn of the wheel; a transformer turns high current at low voltage into low current at high voltage, or back again. Like gears, it trades one for the other and never gives out more power than goes in.
Core idea. Both coils share the same changing flux, so every turn has the same induced voltage: the voltage ratio equals the turns ratio, and because power in equals power out, the higher-voltage side carries the smaller current.