The inside of your patio door’s lock, like all other locks, needs lubrication to keep the different metal parts inside moving freely. Over time the original lubrication can wear out, making the lock increasingly difficult to turn until it one day does not work at all. Powdered graphite, available at most hardware stores, helps with lubrication, as does a penetrating lubricant such as WD-40 you spray into the lock mechanism. You need to work your key around in the lock for several minutes after you lubricate it to spread the lubrication.
When the outdoor temperatures dive below freezing, the lock on your patio door may become victim to the cold. If moisture enters the lock it can freeze inside, creating a barrier of ice that stops all movement inside the lock and may even keep you from inserting the key in the lock. Use a screwdriver, nail clippers, a mail opener or another small tool to break apart and remove any ice covering the outside of the lock. If the lock still does not work, spray a lock deicer into it. If you do not have a deicer, heat up your key with a match or lighter and insert it into the lock.
Your patio door lock may not have a problem at all, but the key you are using to open or close the lock is the source of the trouble. Examine the key carefully for signs of damage such as rough edges, gouges in the metal and corrosion. You may be able to file away some damage, while other key damage may require you to replace the key. Also, shine a flashlight into the lock mechanism to check for key pieces. Someone else may have sheared off part of a key in the lock.
Patio door locks, like other mechanical devices, do not last forever and eventually will fail. If your lock does not work after you have tried other fixes, it may be time to remove the lock along with the handle and install a replacement. Your local home improvement store should have a wide variety of door handles with lock mechanisms to choose from. Pick a handle and lock that are designed for exterior doors since they are designed to withstand the elements better and feature a more hefty lock to keep intruders out.