Unless you're a scientist specialising in data recovery, you won't be able to repair a physically damaged SIM card yourself. Forensic services like SIMIS (Subscriber Identity Module Interrogation System) use decapsulation, X-rays and advanced cleaning methods to recover and repair physically damaged SIM cards. If you'd like, you can always consult one of these forensic services and get a quote on your repair. If your SIM card isn't physically damaged but not working properly, you can use a SIM card reader to repair it yourself.
Buy a SIM card reader that will suit your needs. These readers can be as small as a USB drive costing only a few dollars, or large enough to hold several cards simultaneously and run upwards of £65. The reader you buy will depend on your needs. You likely won't need a reader that can hold multiple cards at once.
Connect your SIM card reader to your computer and follow any installation instructions. Some SIM card readers are plug-and-play, meaning they're ready to go once they're plugged in, but most will require installation of specific software provided with the reader.
Insert your SIM card into your SIM card reader. The SIM card will only fit into your reader one way, so make sure to follow the instructions correctly to avoid damaging your device.
Open your SIM card reader program on your computer and go through the steps you'd like to take for repair. You can configure your card, as well as restoring much of the history that has both been saved and deleted on the card.
Exit out of your program and remove your SIM card from the SIM card reader. You can now put your SIM card back into your phone.
If your SIM card is badly damaged (for example, split in half), you may have to buy a new SIM card all together. You may be able to recover some info, however, by using a specialised forensic service.