Playing the part of Dungeon Master (DM) in a game of Dungeons & Dragons, or any tabletop game for that matter, is entirely different from being one of the adventuring party members. As a DM, you are the narrator of the game. All decisions about the world fall to you. If you say no, something cannot be done. It's as if God stepped in and stated it for you.
With that said, what is a DM to do when a player or an entire group of players attempts to brute force their way past a puzzle? For the sake of a common example here, let us say that the party has traveled far from town to the mountains and have arrived at their location, only to find that the entrance is a massive stone door laid right into the mountain.
As DM, you instruct the party that they must use the Elvish word for “Friend” for the door to open. You completely think of that on your own, claiming to have never even heard of this "Tolkien" fellow.
No one considers the riddle, the player who knows Elvish forgets they know Elvish, and the Barbarian is trying to smash the door down. What should you do as a DM?
Letting Them Do It - How to Implement Consequences On The Fly
Perhaps the party happens to have tools that could reasonably be used to dig through the side of a mountain. If the party is well-stocked, say with a number of pickaxes, a Dwarf or other race who loves to dig, a DM could allow for them to work on the stone for an hour, to produce some form of “door.”
All the while, a DM can have players make sound checks, and have be rolling for the nearby NPCs and creatures to see if they hear anything. Do your players decide to make quick work of everything by adding blasting powder? Gleefully encourage their creativity while you also prepare for the awakening of a nearby camp of goblins, or bears, or the dreaded Goblin-Bear.
In this sense, allowing the party to do something unexpected and somewhat ridiculous, since no one would smash through a door because they forgot their key or password, comes with a reasonable set of consequences in the form of making noise, and perhaps drawing unwanted attention to themselves.
Everyone has a good laugh and learns something at the same time: the DM learns that their particular party of adventures may be impatient, and the players learn that creative solutions can bring unexpected dangers.
Telling Them "No" - When It's Okay To Decline The Brute Force Attempt
Sometimes a proposed “solution” to the problem of the stone door is simply unacceptable to a DM. Perhaps it is meta-gaming, or bordering on the completely preposterous, even for a fantasy game. Even it's just because you feel like it, you can say no to the brute force mechanics being inflicted on your door.
It may be one player you need to convince, or maybe the whole darn party. But be confident in your answer and your reasoning. The reason a mountainside was chosen, with a massive stone door that only opens to magic to boot, is because that stone is some of the most difficult material in the D&D world to deal with.
If this were an old rickety door on rusted hinges at a tavern, the party could easily force their way in. But tons and tons of stone? That now falls into the realm of impossibility. Perhaps the entire party states that they will dig through the stone, but all they have are swords, shields, daggers, and at best, perhaps a small shovel.
Saying no should suffice, but if they are persistent in their plan, a DM could allow the action to go on for an hour, and then blunt, break, or otherwise make ineffective their expensive weapons that are not meant to be abused in such a manner against solid stone.
Perhaps the various magic users pipe up, declaring that they will cast Stone Shape or some other variation that allows for a five square foot cubic volume of stone to be changed at will. This is their prerogative, of course, but as a DM we can make the wall and door as deep as we need it to be. If we make it 100 feet deep, the magic user will need to cast their spell twenty times and use a component for each. Maybe we throw in a section of rubble after a few casts, so that they must abandon the plan as each stone, regardless of size, needs its own cast.
In effect, no magic user is likely to have that many spell slots, nor will the party have enough food and water to sit and rest for days while they cast the spells repeatedly.
Of course, if the party keeps persisting, and you're forced to add more and more hard counters on top of simply saying "no," there may be a larger issue present.
"Why Is This Happening?" - Consider Why Your Players Are Doing This
Ultimately, for a player or an entire party to adamantly demand some brute force solution to a puzzle, and for conflict to arise as a result of a DM’s refusal, there likely exists some larger issue.
If we gave ten DMs the same campaign and told them to run it as they saw fit, we would likely see ten drastically different adventures unfold. The parties would all be different, as well as the experience levels among its players, on top of the type of adventure each wants to have. One party may treat it low fantasy, relying on realistic physics and logic, while others may be the opposite, employing magic in the loosest interpretations of their rules.
Neither is a more correct way to enjoy the game, so long as everyone is on board.
Knowing your party is key in this case. Maybe the party is filled with adventurers who love combat, with Barbarians who only want to smash. A DM could simply work to create a puzzle that harnesses that inner rage.
With that in mind, a DM may sometimes not jive with the party, or more likely, one individual leading the rest. Dealing with a problematic player is another matter entirely, but nothing that cannot be handled through conversation.
The issue too may relate to how a DM has handled previous situations, which is often precedent for how future cases are handled. If a DM allows their players to brute force their way through a puzzle, and then presents a similar challenge in the future, what else should one expect but the same behavior?
This comes down to communication, and as mentioned earlier, recognizing that some parties are simply not interested in puzzles and riddles.
It's Up To You
Ultimately, the DM is not an adversary or an avatar for the final boss of a campaign. The role of DM is meant to be that of guide, one that builds an immersive world through many NPC voices and settings, by acting as shopkeeper, as the proprietor of an Inn, and much more with the aim of showing the way.
In whatever way you choose to handle the situation, try to keep your cool and not resort to a Total Party Kill (TPK).
Or perhaps just one TPK, depending on the group.
This guide was modeled after a similar question found here.