If it is important I allow an intelligence check with a relevant skill, however I don’t base it on the type of creature but more on the players background.
For instance a Druid wanting to know if they know a trolls weakness would use nature based on what they have learnt or understood from there time learning from other druids.
A fighter asking the same question may use history, to see if they heard a tale told in a bar or while sat round a camp fire.
A wizard would of course use arcana to see if they had learnt the magical properties of this creature in there lessons.
Therefore in the same combat 3 different players may make different types of roll to identify the same creature.
But I also allow an element of meta gaming in here, yes that nasty word, so if a player says that’s a troll I know it’s resistant to x and susceptible to y I just say, great your character knows that. There is no point forcing players to throw attacks they know won’t work against a monster because “it’s what your character would do” just because they failed some arbitrary dice roll to identify it likewise penalizing a wizard for growing a fireball against a troll despite failing the arcana roll to know its weak against fire, when the wizard throws fireballs anyway, is also pointless.
Characters know stuff, if the player doesn’t know then make them
make a role if they do great, just go with it, your character once heard in a tavern a tale about this creature.