I'm new to D&D and I'm a bit confused about using lore. I already saw Does D&D 5e have a rule for character knowledge about monsters? and know that a PC can use knowledge skills to learn about things, but I'm not sure what they can learn.
Let's say during or after a combat a player asks about the enemy creature, for example a goblin, and they want to use a knowledge skill for this. As the DM, I set a DC for the roll and if they succeed… what can I tell them about the enemy? Can I tell only goblin lore — origin, how they live, etc. — or can a DM even say its attributes such as AC, HP? Is there any way a player can even ask about enemies abilities or attributes? If an enemy monster has some special actions apart from melee/ranged attacks, is there any way for the players to find out by the rules when the DM must tell them?