Why does the key turn the lock cylinder, put still won unlock the door?
If the key is just spinning around, then the tail piece is broken or it fell off. The lock has to be disassembled and the tail piece replaced or reattached. If the key turns to the normal position, then the latch may be defective or just sticking on the door jam strike plate. First try pushing or pulling on the door as you turn the key. If that doesn’t work, the lock has to be removed and the latch torn out to open the door.