Imagine this: you have just come home from a long day with the groceries and your feet hurt and you need a cup of tea and an easy chair in a bad way. You stick your key in the lock and unlock the door and turn it back to the position for removing the key, but the key doesn’t come out. No matter how hard you pull, the key stays in the lock! Try pushing on the lock’s face just next to the key as you pull on the key. I know it is counterintuitive, but you have to push the lock right next to the key as you pull the key out. The key will only come out when it is oriented vertically, just like it normally does.
If it pulls out, it is a (relatively) easy fix but the fix needs to be done soon or your lock will fall apart. Most likely the problem arose due to a screw cap getting loose on your lock cylinder. Usually all you need do to fix this is use a philips screwdriver to take your deadbolt apart and tighten the cap on your deadbolt’s cylinder by pushing the little metal pin down while twisting. If you have another problem, at least you can push the key out from the other side. For knobs it is too complicated to explain all of the remedies and variations of disassembly (though the same cause is possibly the root of the problem). You will just have to call.
The reason this often happens is because the pins have dropped into the cuts of your key and when you pull on the key, the pins bind sideways instead of sliding up into their chambers as you pull the key out. Pushing on the lock cylinder’s face keeps the lock cylinder’s chambers in line with each other so that the pins can slide up out of the way of the key! Lubrication can stave off the problem but it won’t cure it.
If this doesn’t work you can also try the time-tested jiggling of the lock. If you have a cheap lock, jiggling it around will make it work for years after the key has worn down over .015″ from its original cut depths. If your lock is cheap enough, you can even jiggle it open with a popsicle stick! If you have something narrow enough to stick next to the key in the keyway, you can lift the pins up manually. Just be sure not to break that object off in the keyway, or your troubles will be exacerbated!