To maintain the safety and beauty of your deck, you should inspect it carefully once a year and perform any necessary repairs. Rotten wood, loose joints, and missing slats are ugly, but they can also cause serious injuries.
First, remove and replace broken or rotted wood. If you're not sure, replace it! It will only get worse with time. Carefully inspect the frame and floor joists; these are the most common places for rot to occur. You may need to remove the floorboards to do this; if you do, consider re-installing them upside-down. This will allow you to enjoy the fresh, unblemished surface of the boards. Just make sure you seal the faded surface first, to prevent water damage!
Now is a good time to remove any debris that has accumulated beneath your deck. If this is a storage area for your family, sort through and discard damaged or unwanted items. Pull weeds and discard any trash that may have blown underneath the structure. Check along the exterior wall of the house and seal any gaps, cracks, or holes that might allow pests, drafts, or moisture into your home. Damage like this often goes unnoticed when it's concealed by decking.
Covering the edged of the floor joists with strips of rubberized roofing membrane will prevent moisture from collecting in the joint and causing rot. A two inch or wider strip will provide sufficient coverage for a 1-1/2" joist. Once this is done, replace the floorboards.
Reinforce joints with glue and hammer in loose nails. Use a nail set to force the nail head below the surface of the wood; this will make it more secure. Be careful to avoid denting the wood; the mark will be very visible once stained.
Another idea is to replace loose nails with wood deck screws. You should give serious thought to this; nails always loosen, given enough time, whereas screws rarely fail. When pulling nails, shield the deck from ugly dents with a piece of thin wood. Choose deck screws an inch longer than the nails they're replacing; that way, the screw can bite into fresh wood for a tighter hold. Countersink the screw slightly; that is, drive it in until the surface is slightly below the surface of the wood. At this point, you can leave it as-is (most people do) or cover the screw head with wood putty.
Once all the visible loose nails are taken care of, walk up and down each floorboard, checking for give. Try to wiggle the handrail; if it moves, add a couple more screws to tighten it up.
Now that your deck is in good structural shape, it's time for the final touches: powerwashing, sanding, and staining or painting.