If you have one of those keys which are basically a flat bar with notches cut out of both sides (On Guard and Krypronite both) You have to work it back and forth. The key passes a series of discs which need to be aligned for the Key to come out. Note that on both these locks the key cannot be removed in the open position. If you can still turn it or better yet open the lock, turn the key all the way to the open position, then all the way back to closed, then try to ease the key out.
If the issue is that the key is stiff to turn or jammed, lubricating the keyway won't help. The problem is in the sliding deadbolt which may be sticking or rusty. If you can open the lock, remove the U-bar and spray some WD-40, tri-flow, or other light oil onto the mechanism and work it back and forth with the key until is slides freely over the full range, then try bringing to the locked position to remove the key.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.