Resistors and capacitors are basic electric components that are found in almost every circuit. All electric components have specific power tolerances, and exceeding them will make a component burn out and fail. If you exceed the voltage rating of an electrolytic capacitor it can actually explode. At best, a defective component will make a circuit behave unpredictably, and at worst cause a cascading failure that destroys other sensitive components. You can test a resistor using a device called a multimeter, or an ohmmeter. Testing a capacitor is trickier, and requires an analogue meter.
Determine the nominal value of the resistor (in units of "ohms") by examining the coloured bands on the resistor.
Set your multimeter or ohmmeter to test the next highest resistance range greater than the value of the resistor. For example, if you're testing a 100k ohm resistor and your meter has settings for 50k ohms, 100k ohms, and 200k ohms, set it to 200k ohms. Ohms are indicated by the Greek letter omega, which looks like an upside down letter u with feet.
Turn off the device and physically disconnect it from power by unplugging it or removing the batteries, if the resistor is still in a circuit.
Touch the meter's probes to the resistor's leads. Resistors aren't polarised, so it doesn't matter which probe you connect to which lead.
Compare the reading on the meter to the expected value of the resistor. If the reading doesn't match the expected value, the resistor is defective. Keep in mind the tolerance rating of the resistor. For example, if you're testing a 200k ohm resistor with a 10 per cent tolerance, readings between 180k and 220k ohms are fine but anything higher or lower indicates a problem. A completely burnt out resistor may give a reading of infinite resistance on an analogue meter, or an error or "out of range" message on a digital meter.
Look at the capacitor, but don't touch it. If it's swollen, asymmetrical, corroded or discoloured it's definitely defective.
Turn off the circuit the capacitor is connected to, if any, and physically disconnect the circuit from the power source.
Discharge the capacitor before handling it by touching a screwdriver with a plastic grip or a resistor across the leads of the capacitor. If you use a resistor to discharge the capacitor, handle the resistor using a pair of pliers with an insulated grip.
Remove the capacitor from the circuit, if it's connected to one. Other components in a circuit can influence the behaviour of a capacitor and make the meter reading meaningless.
Touch the probes of the ohmmeter to the leads of the capacitor. If the capacitor is polarised, connect the positive test probe to the anode of the capacitor and the negative test probe to the cathode, which is usually identified on the capacitor by a "-" symbol. The needle on the meter should swing away from infinity and then climb back up. If the capacitor's value is in the picofarad range or lower, this will happen very quickly. The higher the value of the capacitor, the more slowly the resistance reading will swing back up. If the needle stays at low or zero resistance the capacitor is "shorted" and defective.
While the ohmmeter can indicate a shorted capacitor, the test is indirect and can't definitively prove that a capacitor is working properly. Considering that most capacitors cost pennies and you have to remove a capacitor from a circuit to test it anyway, it's often simplest to replace a suspect capacitor without bothering to test it. Either a digital or analogue multimeter or ohmmeter is fine for testing a resistor, but digital meters are more useful because they give you a precise reading. However, you need an analogue meter to test a capacitor. Very tiny resistors (called surface mount devices, or "SMDs") have become common, especially in digital electronics. SMD resistors don't use the traditional colour codes. See the Resources section for a guide to determining SMD resistor values.
A capacitor can store a charge for a long time after it's been disconnected from power, and may give you a nasty shock if you handle it without first safely discharging it. Powerful capacitors can even store enough charge to kill you. The physical size of a capacitor does not necessarily indicate its capacitance value, so handle all capacitors with care.