Clean the existing grout with a scrub brush and a commercial grout cleaner. This will remove dirt, mildew and other debris from the grout. Allow the area to dry completely.
Use a grout saw to remove the damaged grout. Grout saws are inexpensive and can be purchased at most home improvement stores. Break off any loose grout with the saw. The grout saw grinds the damaged grout away.
Use a wet cloth to moisten the grooves where the new grout will be applied. Do not saturate the area, but be sure that it is damp. A bit of moisture is important for the grout to properly adhere to the tiles.
Mix a batch of grout as instructed by the packaging. Do not mix too much grout ahead of time or it may harden before you have a chance to apply it.
Spread the grout over the surface area that needs to be filled. Use a grout float to smooth out the grout, applying even pressure while working the grout into the joints.
Even out each joint once you have them full. Wet your finger and smooth the grout into the joints.
Remove the excess grout in the joints and on the tile faces by going over the surface area with a squeegee or a grout sponge. Avoid going over a specific section multiple times; this may interfere with the grout that has begun to dry in the grooves.
Allow the grout to dry according to the manufacturer's instructions. Apply a grout sealer to protect the grout from future stains and mildew.