Repairing a water main first requires locating it; these pipes are almost always buried, which can make them difficult to find. Next, it's important to determine if repairing the pipe is safe and worth the risk of having to repair problems in the future.
Water mains connect homes to a municipal water supply, so they're larger than most house piping. In addition, they have to deal with water that's under heavy pressure, which can strain them over time. Water mains are designed to be durable, but corrosion and constant pressure can cause them to break.
After locating the water main, the entire pipe needs to be thoroughly inspected. Water mains are designed to last for extended periods of time, so problems with one part of the pipe might indicate more widespread problems. It's sometimes possible to patch a small crack or other minor damage by placing a cramp around it, and experts can sometimes remove a small portion of the pipe and replace it. However, doing so threatens the integrity of the pipe and might leave it vulnerable to future problems, especially if it's an old pipe that shows signs of wear. Because of this, it might be worth spending a bit extra to replace the water main instead of trying to repair it.