Measure the diagonal distance from the top of the hinged gatepost to the upper corner of the opening-side gate frame. Add 12 inches to that dimension to calculate the length of the cable. Measure and trim the cable to the calculated length.
Drill a pilot hole about 2 inches from the top of the gatepost on the same side as the edge of the gate. Insert the threaded shank of a heavy-duty lag hook into the pilot hole and turn clockwise to tighten. For increased torque, insert a screwdriver into the hook, then turn. Turn the hook until its curved portion meets the gatepost.
Drill a pilot hole into the center of the top rail of the gate frame, about 2 inches from the opening-side edge. Install a heavy-duty lag hook in the pilot hole.
Thread about 6 inches of cable through a cable crimp. Pass the short end of the cable through one side of a swivel link, then back through the cable crimp. Compress the crimp with crimping pliers to secure the swivel to the cable. Use bolt cutters to trim excess cable. Hang the cable by the attached swivel onto the hook installed on the gatepost.
Thread the free end of the cable through a cable crimp, then through a swivel link. Hook the swivel link onto the lag hook installed on the gate rail. Lay a carpenter's level on the upper gate rail. If the gate has already begun to sag, lift the opening-side of the gate, then place scrap lumber between the ground and the lower gate rail to level the gate.
Thread the free end of the cable through the crimp. Pull the cable taut between the swivel links attached to the gatepost and gate. Compress the crimp, securing the swivel link to the cable. Trim excess cable.