How to install a dimmer switch or just to replace a light switch. Don’t use the cheapest light switch you can buy. Spend at least 1.50 for a regular switch. It’s just not worth it.
Some dimmer switches may require the use of a neutral. In most cases, this would be the white wires in your box. But test it first to make sure.