Clean the lock cylinder by spraying canned air into the lock opening to clear any dust or debris.
Lubricate the lock cylinder with a few sprays of multipurpose spray lubricant or apply powder graphite.
Unfreeze the lock. Moisture combined with subfreezing temperatures can cause the components inside the lock to ice over. Thaw the lock with a hair dryer or spray deicer into the lock cylinder.
Have a new key made. If you're using a key to secure an inside deadbolt lock, attempt to lock the door with a spare or new key. Keys can develop rough edges, impeding their ability to lock and unlock doors.
Replace the lock. Worn or broken parts might contribute to the lock's inability to function.