The operation of a deadbolt isn't complicated -- you turn the handle or key, and the bolt slips through the strike plate and locks the door. The lock works best if the bolt fits tightly; that eliminates the possibility of loosening the lock by shaking the door. Because of the tight fit, the bolt can easily fall out of alignment, and the bolt may stick or it may not lock. Sometimes, the lock mechanism can stick simply because it needs lubrication. That's easily remedied by disassembling the lock from the inside of the door.
Open the door all the way and tighten all the hinge screws with a screwdriver. If you find a screw that won't tighten, replace it with a 2 1/2-inch wood screw that will bite into the wall stud. Doorjambs are relatively thin, and screws often pull out of them, especially when supporting a heavy entrance door. Stabilizing the hinges may correct the problem with the lock.
Extend the bolt all the way, close the door and mark the positions of the top and bottom of the bolt on the jamb with a pencil. Open the door and check the alignment of the marks with the top and bottom of the strike opening. There are two ways to fix the strike if the marks don't line up.
Grind the top of bottom edge of the strike opening with a rotary tool and a grinding accessory to correct a misalignment of 1/8 inch or less. If the misalignment is greater than 1/8 inch, unscrew and remove the strike, chisel out the opening, and reposition the strike to line up with the new opening. Fill the screw holes with epoxy putty, drill new 1/8-inch pilot holes for the screws and reset the strike.
Spray lubricant into the keyhole to lubricate a lock mechanism that won't turn. If this doesn't help, disassemble the lock. To do this, remove the rosette from the handle inside the door and unscrew the two bolts holding the lock together. Pull the lock apart, spray lubricant on the mechanism, and reassemble the lock.