Point-and-shoot and digital SLR cameras have a knack for attracting dirt, and that grime can show up in pictures. Sand and moisture at the beach can render a good camera unusable. Here's how to clean it.

Wipe down the body and the LCD screen, if they are dirty, with a soft cloth. If needed, apply a mild alcohol-based cleaner to the cloth. Be careful as you work around buttons and openings not to let liquid get inside.

Pay special attention to cleaning a dirty lens. Puff away loose, abrasive materials with an air bulb. Use a scratch-free cloth, a lens-cleaning solution, and a light touch to clean the outside glass. If you haven't yet, screw in a clear filter to protect digital SLR lenses from scratches. Clean the inside of such lenses by first squeezing air and then lightly swabbing with a lens-specific cleaner.

Handle the sensor plate with care. The CMOS or CCD in the camera body can be blighted by dust particles. Point-and-shoots seal foreign matter out, but changing digital SLR lenses invites dust. And be warned: Canon, Nikon, and some other manufacturers don't support users cleaning their own hardware; if you scratch the sensor plate, you'll have to pay for the repair.

Mount the digital SLR on a strong tripod, if possible. Then tilt the camera slightly downward prior to cleaning; the tripod will keep your hands free, and the downward angle will permit loose particles to fall off. Within the digital SLR's menu system, enter the mirror-lock cleaning mode to lift the mirror away from the sensor. Use a battery with a strong charge; if the camera loses power in this process, the mirror will snap closed, causing damage if you're swabbing.

Use an air bulb to clear the image sensor. Compressed air is too powerful for this job. Po­­sition the nozzle about an inch away from the sensor. Squeeze the bulb in short blasts.

Perform deeper cleaning with a swab and a solution made specifically for your camera. A few sites -- among them, Copper Hill Products, Photographic Solutions, and VisibleDust -- sell these supplies.

Unwrap a disposable swab, and add a drop or two of solution to it. Gently but firmly drag the wand horizontally across the sensor in a single sweep. Twist the wand over to its unused side, and gently swipe back in the opposite direction.

Take a test photo. Magnifiers and other tools can help you get a closer look at the results of your cleaning efforts, but snapping a photo works best.

Attach a lens to the digital SLR, and shoot a picture of a blank background-for example, a piece of paper-with as small an aperture as possible. (Set the camera for aperture-priority, and expose the photo normally.) On your computer, zoom in on the picture, and look for splotches or droplets. If you see any, repeat the cleaning steps.

Avoid exposing your camera to sudden changes in temperature. A quick transition from, say, cold outdoor weather to a warm house can cause condensation. Seal the camera in an airtight bag or two, and leave it alone indoors until it gets acclimated.

Deal with condensation promptly. Remove all possible parts -- battery, memory card, lens -- and leave the camera doors open. Let the condensation evaporate overnight on its own.