D&D 5e comes with a number of spells and abilities that allow characters to scout ahead without any risk for life and limb. For example:
As a wizard or warlock, you can have a familiar, and with invisibility even an invisible one. Some of these familiars even may be able to open doors and have a range of up to one mile, allowing you to scout entire dungeons.
A druid can shapechange themselves into an innocous looking spider, mouse, cat or similar small animal fitting to the environment to scout and explore.
Alternatively, as a druid or ranger, you can conjure woodland creatures, including sprites, which are intelligent and likewise can invisibly and flying scout ahead, open doors, and report back.
These lower level tactics using familiars or similar animals have already been discussed, in How do I handle the wizard's familiar invalidating exploration, outshining the rogue, at low to no cost?, How do I handle a player exploring the entire dungeon with his familiar?, As a DM, how can I handle my Druid spying on everything with Wild shape as a spider?.
Such exploration tactics tend to have a playability issue, as the player controlling the exploration is normally the only actor, and all the other players are sitting around doing nothing. That is a real problem, but not my problem here.
The other issue is that such tactics undermine the exploration pillar of the game, by removing risk from it. They make it much less likely that you are surprised or ambushed, and they inform the group where and how to attack. Because they are so powerful and so effective in reducing the level of danger, the players have a strong incentive to use them. But if they do, instead of their characters experiencing adventures, for large swathes of play time, the characters sit back somewhere holed up safely in mission control, while their minions do all the adventuring.
Essentially, the DM could just hand the players a map of the dungeon with a description of the rooms (minus those that are well hidden behind secret doors, unless the players systematically screen empty space with their earth elemental). The players then can decide where and how to alpha strike.
Several answers acknowledge that by recommending to do just that: hand the map to the players, and focus on a different kind of challenge, planning the perfect heist with great intel on the target.
For me, removing this part nearly entirely removes some possible enjoyment from the game, both as a DM and as a player. I feel it removes some of the tension and excitement that comes from risk. At the same time, I think it is hard to justify for the players to not use the tools that their characters have at their disposal to minimize risk and maximize their chances of survival.
Low Level Answers
Apart from recommending to just accept it, answers to these questions for lower level tactics cover two possible solutions:
Familiars are quite vulnerable, and can be discovered and easily killed.
This exploration still misses a lot of dangers, because opponents may move around, and maybe as importantly, because the creature still can miss the secret doors, traps, alarms, invisible foes (unless a bat familiar), illusions, shapechangers, false appearance monsters and cannot access areas behind locked doors. So, even if you have a map, it is going to be a map with lots of nasty surprises and undiscovered areas.
My question here is focused on how to deal with the same issue at higher levels:
As a mid-level druid or wizard, you can conjure elementals, including invisible stalkers and earth elementals, which likewise can move around undetected, open doors, or earth glide to spy on the interiours of dungeons and report back to you. As a druid you also can take the form of an elemental yourself.
These are not only much harder to kill, the earth elemental also has an Earth Glide ability that allows it to burrow through nonmagical, unworked earth and stone without disturbing the material. In dungeons dug out of rock this allows it to effectively move through the empty space around the rooms, peek into the rooms, and to also discover all kinds of otherwise secret rooms, tunnels, trap shafts. (And for me it is not an option to just not use dungeons -- the frigging game is called Dungeons & Dragons).
As a high level wizard, you can use Etherealness to get or give allies super-invisibilty that also allows you to move through walls, and even more effectively allows you or a minion of your choice to scout everything including most hidden aspects of the map.
So the weak and easily killed aspect of the low-level solutions does not work that well (although, at higher levels, the monsters will be stronger, it still is pretty rare for them to be able to deal with creatures in solid rock or on the Etheral plane. I've had may share of Readied Action standoffs by the dungeon's denizens trying to catch the elemental when it peeks in.
What is worse, the "missing crucial information" aspect also does not work that well -- these tactics may be more successful in discovering hidden threats and treasures than the PCs themselves when they are walking through the dungeon.
I am interested in "good subjective" advice on what has worked for other groups to counter such tactics and make it a more rational decision for players engage more directly with their environment. I don't expect to entirely invalidate them, just useful ways to have them carry a reasonable amount of risk and downside.