The answer to 'how to maintain grout' is to clean and seal it regularly. Grout is porous material that can easily stain and accumulate dirt, so it requires ongoing maintenance to keep it looking its best. Start by sweeping or vacuuming the grout lines to remove any loose debris. Then, use a grout cleaner or a mixture of warm water and mild detergent to scrub the grout with a stiff-bristled brush. Rinse the area thoroughly and allow it to dry completely.
Once the grout is clean, you should seal it to protect it from future stains and damage. Apply a high-quality grout sealer according to the manufacturer's instructions, making sure to cover the entire grout line. Reapply the sealer every 1-2 years, or as needed, to maintain the protection.