The first step in getting rid of a refrigerator odor is to find and remove its source; any cleaning done while the source remains will be undone within a few days. Once it is removed, wash the shelves and drawers, check the folds of the door gasket and the drain hole on the back wall, then leave an open container in the refrigerator to absorb odors.
Because an odor is a symptom, look for its source first. There is often an obvious cause: a bruised piece of fruit in the crisper, a container forgotten on the back shelf, a leaking package of meat, or an open jar of pickles. Empty the refrigerator completely, smell each container one by one, and discard anything suspicious promptly. As you empty it, put the food in a cooler; food left on the counter while you deal with the odor can create a whole different problem. Checking the date on each container as you empty the refrigerator also turns the search into a second task.
Once the source is removed, wipe down the surfaces. Take out the shelves and drawers and wash them with warm water; wipe the interior with baking soda solution—1 tablespoon (15 ml) per 1 liter of water—and dry it with a clean cloth. Vinegar can also be used, but its own smell will linger in the refrigerator for a while. Do not use scented cleaning products: the inside of the refrigerator shares air with the food, and a perfumed surface replaces the odor you want to remove with another that lingers. Do not use bleach either; its residue can transfer to food if the surface is not rinsed off.
Two spots are often missed during cleaning, and the odor returns from there. The first is the folds of the door gasket: spilled liquid seeps into them, cannot be seen, and will not come out unless you open the fold and wipe it with a warm, damp cloth. The second is the drain hole below the back wall. Condensation drains through it; when a bread crumb or leaf fragment clogs the hole, the water that collects becomes stagnant, and that water is what produces the musty smell that spreads through the refrigerator. Clear the hole with a soft rod, then remove and wash the drain pan behind it.
After the surfaces are clean, leave an open container to absorb any odor remaining in the air. Baking soda is the best-known option: put two finger-widths of baking soda in a bowl, place it on the back shelf, and replace it once a month. Coffee grounds, unroasted coffee beans, or crushed activated charcoal do the same job. None of these containers removes an odor overnight; they need to remain open for a few days, and none will help if the source has not been removed. Odor-masking sprays hide the problem; they do not solve it.
If the odor does not return, the job is done; if it does, the source is still inside and the search should be repeated. A lasting solution comes more from habits than from cleaning: keeping all food in sealed containers, writing the date on opened products, and doing a quick check once a week can prevent a forgotten container from making the refrigerator smell. Odor absorbed by plastic containers is a separate problem: take those containers out of the refrigerator and deal with them separately; as long as they remain inside, they will continue to spread the odor. The smell in an old, deeply scratched plastic container will no longer come out, so retire it from food storage.