Switch off the electricity to the switch.
Remove the old switch from the wall.
Identify the hot, neutral, and ground wires.
Attach the wires to the new toggle switch's matching terminals.
Attach the new switch to the wall and replace the cover plate.
Reconnect the power source and test the switch.
When working with electrical components, remember to use caution and safety, and seek professional assistance if necessary.