Although you can't guarantee which wires will be live, black or red wires generally are. White wires are often neutral, but not always, especially if they're marked with black or red paint or tape. Green or bare copper wires are ground wires.
When you're replacing a switch or outlet, the insulation that covers the wires will need to be trimmed to reveal about a ½ to ¾ inch of bare, clean wire at the end. Although you can use long-nose pliers to strip the insulation off the wire, a “multipurpose” or “combination” tool that clamps together to form holes to fit various wire diameters (gauges) is designed for this. Close the tool over the wire in the appropriate wire-gauge hole, twist the tool around to cut the insulation, and pull the tool toward the end of the wire to strip off the insulation.
Most switches and outlets come with two options for connecting the wires: screws around which you bend the wire (trim ¾ inch of insulation from the wire's end, and bend the end into a hook that fits over the screw; then tighten the screw down around the wire); or holes into which you push the wire (trim l/2 inch of insulation from the wire's end, and push the wire into the hole). Although the push-in wire holes are acceptable by most codes, the Consumer Product Safety Commission suggests that these can loosen and overheat. Check the cover plates on these switches and outlets regularly to see if they're warm to the touch (if they are, replace them, and use the screws instead of the push-in holes). Better yet, use the screws in the first place.
If you need to remove wires from push-in holes, use a small flat-bladed screwdriver to press the metal tab down in the slot beside the hole. This should release the wire. If it doesn't, you'll have to cut off the wire as close as possible to the outlet or switch.
When replacing outlets and switches, buy replacements with the same voltage and amp markings as the old ones. If in doubt, remove the old outlet or switch, and take it to your home center.