For AC, you use a transformer which is, basically, two coils of wire wound on a common core. The voltage step-up or step-down is determined by the ratio of turns in each coil. A transformer passes power (Voltage times Current), so if the output voltage is higher than the input, the output currrent will be lower than the input current.
Transformers depend on the varying magnetic field induced by the varying AC voltage to induce a voltage in the output (secondary) coil. No parts other than the transformer itself are required to do the voltage conversion.
For DC things are more complicated since DC, by itself, does not produce a varying magnetic field, so a transformer alone won't work. Instead, we have to use some electronics or other means to chop the DC input into pulses, which a transformer will "see" as AC. A transformer can then be used to step this chopped DC voltage up or down as required.
A DC-DC converter (also called a Switch Mode Power Supply, or various other terms depending on the exact application) can be used to step a DC voltage up or down - like the transformer, it passes power, so if the output voltage is greater than the input, the output current will be lower than the input.
Linear voltage regulators reduce voltage by acting like a resistor, so the output current will always be the same (or slightly less) than the input currrent. The "resistance" of the regulator will be automatically adjusted to keep the output voltage at the desired value.
Series resistors and resistor voltage dividers can also be used to reduce voltage, but the voltage reduction will vary depending on the load current.