The answer to 'how to repair shingles' is to first inspect the damaged shingles and determine the extent of the repair needed. For minor damage like a cracked or missing shingle, you can typically replace the individual shingle. For more widespread damage, you may need to replace an entire section of the roof.
To replace a single shingle, first remove the damaged shingle by carefully prying it up. Clean the area and apply a new layer of roofing cement, then press the new shingle firmly into place. Secure the edges with roofing nails. For larger repairs, you may need to remove a section of the roof and install new shingles, underlayment, and flashing. This is a more involved process, so it's best to call a professional roofer for extensive repairs.