It's difficult giving step-by-step instructions without knowing exactly what you have now and what the new switch is.
However, generally, here are the steps:
1) TURN OFF THE BREAKER FOR THE SWITCH
2) Remove the 2 screws on the plate.
3) Test the wires for electricity - make sure there is none.
4) remove the 2 screws holding the switch into the box.
5) You could have two issues here:
a) If the wires are screwed to the side of the switch, unscrew those wires and replace with your new switch in opposite order.
b) Sometimes the wires are inserted into the back of the switch. If this is the case, cut the wires from the old switch, strip the appropriate amount of insulation off the wire and replace with your new switch.