The answer to 'how does dimmer switch work' is a dimmer switch controls the amount of electricity flowing to a light fixture, allowing you to adjust the brightness. Dimmer switches work by reducing the voltage going to the light bulb, which in turn reduces the amount of power and lowers the brightness. This is done using a variable resistor that is controlled by the dimmer knob or slider.
When you turn the dimmer switch, it adjusts the variable resistor to limit the flow of electricity to the light bulb. At the lowest setting, the resistor blocks most of the electricity, resulting in a very dim light. At the highest setting, the resistor allows full power to flow, making the light as bright as it can be.