The switch you show has two cables, red and black, and red, yellow, blue. It is likely the red and black are switch wires from lamp, and that the red, yellow, blue go to the other switch. So red, yellow, blue into a block connector so can be reused latter, and red and black to the new switch, may be...