As a rule of thumb, the fresher the stain, the easier it will be to clean. So act quickly and follow these stain-busting methods.
Try the mildest solution first. Mix up some "dry suds" using 1/4 cup mild powdered detergent in 1 cup warm water. Beat with an egg beater or whisk until suds form (they should look like whipped cream), then apply suds to mattress stain with a sponge. Wipe with a sponge dipped in warm water and wrung out.
Use an upholstery shampoo to remove tougher stains. Follow instructions on the product.
Use hydrogen peroxide to battle blood stains. Blot the stain with a white towel from the outside in as it begins to bubble. Continue until blood no longer seeps onto the towel. Some blood stains may be impossible to remove.
Remove urine stains in the same way you would remove bloodstains, or try blotting with white vinegar.
Tackle super tough stains with an enzyme cleaner which is a biologically-based cleaner that breaks down stains and odors. Or, consider hiring a professional mattress-cleaning company. Look in the Yellow Pages under "Mattress" or "Carpet Cleaners" (many also professionally clean mattresses.)
Whichever method you choose, be careful to avoid liquids seeping into the mattress' padding. Residual moisture can cause mold or mildew.
Make sure the mattress is completely dry before replacing the mattress pad and sheets.
Stains may void the manufacturer's warranty, so consider using a stain-resistant cover to protect your mattress. When buying a new mattress, ask if the factory can apply a stain-resistant product. Use waterproof mattress pads for bed-wetters. If urine penetrates deep into a mattress's padding, the mattress may not be salvageable. To freshen a mattress, sprinkle it with baking soda and let sit overnight. Vacuum the mattress in the morning.
Hydrogen peroxide can bleach the color from a mattress. Spot-check before using.