There are several things you can try:
Reflavor to hide obvious clues
I GM in homebrew worlds, so I will often reflavor monsters, spell effects, etc to fit my needs. This has the handy side effect of meaning players who can recite the stat sheet of a typical troll are unlikely to realize that the shambling swamp beast they've encountered is, in fact, a typical troll. Likewise, if all portals are blue due to how the spells were created way back when, then the players can never know whether they're going to the Astral Sea or the Abyss just by looking.
Misdirect
This one was mentioned in the linked answer, but to expand on the idea: Have your villains use intelligence when building traps. They might place some really obvious-looking gargoyles by the doors, only for the actual trap to be a pair of living trees. In one game where I was a player, the DM sent us into a library to kill a villain's familiar. The party wizard looked around, spotted a spell scroll he'd wanted for a while, grabbed it, and immediately cast it. Guess what - it wasn't the spell he thought it was, and it turned him into a mouse - just as we were being attacked by a giant cat.
Enforce limited knowledge through notes and whispers
I keep a blank notebook on hand when I'm DMing to write notes that I can pass to individual players, if I want to hand out information that one character would know but the rest wouldn't. If a couple of people know, or if it's an extended scene, I might step outside to another room with the player(s). This ensures other players won't get that knowledge, and also encourages the in-the-know player(s) to share their knowledge appropriately (or hoard it, depending on the character).
Call them out
If a player tries to use out-of-game knowledge, ask them to explain how their character knows it. If they can come up with something like Dale M's experience - perhaps they lived in an area often attacked by trolls - then great, you can move on, and now you can also play up that part of their backstory. If they don't have a good reason, they'll get the hint pretty quickly.
Let it go
In my group, there's four of us that have traded off DMing at various times. We all know the monsters and the other rules/situations pretty well. When one of us recognizes a monster, it's sometimes very hard to deliberately leave ourselves open to an ability we know about, just because it's not likely our characters would have seen it before. This is because it's no fun to lose when you know the answer - so as a GM, just let these instances go. Yeah, it's a little unrealistic, but what's more important: strict realism and adherence to knowledge rules, or having fun and kicking monster butt?