There's basically three options, as I see it, for determining that from the player side. Blind trial and error, picking up on context clues from the DM's narration, and the Study action.
Trial and error is obvious, you do it and see if it works. Context clues are listening to how the DM...