The lighting was perfect, you employed the best settings and features and composed the shot carefully—but your photos or videos are blurry. The culprit may well be a dirty or scratched lens. Here are simple ways to keep crud from messing with your photography:
Wipe off dust and dirt. No matter what device you're using, regularly clean the lenses (and on cameras, also clean the LCD you use to compose shots), especially before important shots. Use a clean microfiber lens cloth and lens-cleaning fluid to gently wipe them off. Never use abrasives or solvents, particularly alcohol-based solvents. With detachable lenses, be sure to clean both ends of the lens.
Cover up. Done shooting? If your camera lens doesn't retract, cover it with a lens cap to safeguard it from dirt and damage. With a tablet or smart phone, use a case to minimize contact between your fingers—and their oil and dirt—and the lens on the device.
Find the best camera for your needs and budget: Check our digital camera buying guide and Ratings.
Keep dust out of the camera's body. With SLR and SLR-like cameras, removing a lens can allow dust to enter the camera and reach its sensor, creating spots on photos. Try not to change lenses in windy or dusty settings. That's wise even with models that have built-in sensor cleaning such as Canon's EOS Integrated Cleaning System, used on a number of advanced models.
If dirt has already gotten into a camera that's still under warranty, send it to the manufacturer to be cleaned. If it's no longer covered, you could try to clean the sensor yourself—but only after consulting the manual, and being careful never to touch the sensor. In general, it's safer to have a professional do the job.