I’d like to add that you need a key. And you must right click on the keyhole block and wait 4 seconds without moving. That’s about it.
I found this, hope it helps https://yomnetwork.ca/threads/dungeon-guide-also-the-best-places-to-loot-in-my-option.36/ (Dungeon Guide! (Also the best places to loot in my option))