Buy a replacement cord for your lawn mower, or purchase some 1/8-inch nylon cord at a hardware or home improvement store.
Remove the cover from the top of the lawn mower engine by taking out the bolts securing the cover to the mower body. The bolt number and size will vary by brand and model, but a common configuration is three 7/16-inch bolts. Pull off any of the old cord still attached to the pulley on top of the engine.
Turn the pulley so the anchor hole for the cord aligns with the location for the cord hole on the top cover. Clamp the pulley in place with a set of vise grips. Thread the cord through the cover hole and the pulley's anchor hole. Tie a knot larger than the anchor hole in the cord. If you're using a nylon cord, hold the flame of a lighter or match to the knot so it fuses together and won't come undone.
Release the vise grips. This will allow the pulley to snap back to its correct position. Secure the cover on the engine, then thread the cord through the guides on the mower handle. Slide the end of the cord through the pull handle and tie a knot so that the cord handle is at the guide hole. Cut off any excess cord with scissors.