Remove the broken handle/lock mechanism from the patio door. It will either be surface mounted or a "mortised" unit that is inserted into the door through the edge. Look for two screws on the handle base that secure the surface mounted handle to the door frame. For mortised locks, look on the edge of the door frame for two screws that hold the unit inside of its pocket in the door frame.
Take measurements of the handle/lock mechanism. Measure the width of the lock. Determine if the end face plate is round or square. Measure the distance between the centers of the mounting screws. Determine the manufacturer of the door.
Get a replacement handle/lock mechanism. Although different manufacturers make slightly different versions, a handle/lock mechanism with the same dimensions will usually work as a replacement, even if the two are not identical. Bring the measurements and if possible, the handle or lock mechanism with you when you shop for its replacement.
For surface mounted handles and locks, simply match up the existing screw holes in the door frame with the new handle. Secure the handle with the screws. If the screw holes do not match up exactly, drill one or both new ones as needed and install the screws. Surface mounted handles are the most forgiving as far as replacements go. They can easily be interchanged, even if the screw holes are not in the same position.
For locks that are installed inside the door frame, or "mortised" locks, first slide the unit into the pocket of the door frame. Insert the actuator rod through the frame and into the lock, following the instructions from the manufacturer of the replacement lock. Once the handle mechanism is working as per the manufacturer's instructions, install the screws to secure the lock into the pocket.