Yes and no - you have to think as a PC without the knowledge and do your best, with integrity, to try to play it out accordingly.You know. Your PC doesn't. When can they make the conclusion? When they have a reason to do so.
In my game: PCs meet a troll for the first time. I have them roll a knowledge check to see what lore their PCs know. Let's say they all get horrible results. Nobody knows the troll's regeneration triggers on acid/fire. They fight it and 'kill' it only to see it get back up as nobody used fire or acid. They knock it down again and keep hacking it apart to keep it from regenerating. They do medicine/investigation/knowledge rolls to figure it out. Nope. Horrible. They may need to run and do some research.That depends upon the relationship between player and DM. If the player has evidenced integrity, and tells me that they think they'd try fire, I'd allow it. If the player has shown a lack of integrity with a history of metagaming, I would say that they rolled their knowledge checks and failed ... so no, they should not use fire.
People talk about this as an inevitable problem, but in my experience, it is only inevitable with problem players. When we have a mutual goal of honoring the fiction, it resolves itself and the story is preserved.
But is it fun? I mean some groups may have fun playacting ignorance, but mine certainly isn't among them!
I prefer the approach of integrating player knowledge into the fiction. the group meets a (bog standard) troll - these PCs have never encountered one before. One of the players whips out a torch (or a firebolt or whatever) and yells "I'm from the Highlands, we KNOW how to deal with trolls in the highlands!" You now have a a fun bit of setting fiction in addition to everything else.
And the nice thing is - this can be subverted. The group encounters a troll the players "know" to use fire. But what they don't know (unless they've already found out) is that this troll has been mutated by the environment, he's no longer that affected by fire - you need to hit him with electricity (ideally there are some clues to this effect leading up to the encounter).