dimmer switch replacement witing
connect the black to black,  connect yellow to red,  green goes to the bare copper that should be in the box if you dont have a ground (bare copper)in the back of your box put a wirenut on the green so it cant find your hot by accident