When it’s a scientific field. If you want to include lots of biology in your book, you’d better know more than ninth grade biology.
When it’s another culture, or even your own culture in the past. If you rely on only prior knowledge and…
Combat. Any kind of combat, really. It’s not about finding the “best” gun or the “best” form or martial art, or the best kind of anything, because that doesn’t really enter into it. An author needs to understands the martial art and the psychology behind it in order to make it work in their story. It’s not uncommon for a character to completely and be unrealistic, because many writers do think that watching a few action movies is enough.
Guns are not interchangeable, from handguns to rifles. A character who uses a Glock will use it and fire it differently than a 1911. Even your lowest capacity Glock will have nearly double the magazine capacity of a 1911, which changes the way ammunition is handled and fired. A 1911 has a seven round magazine, which means the character will be conservative, it means firing a single round down range. Don’t waste ammo you don’t have, while even the lowest capacity full frame Glocks carry nearly twice that much. With a Glock because you have more ammo in the magazine, because of the way pistols handle, there’s a serious advantage to grouping your shots into bursts.
Each gun comes with it’s own advantages, it’s just the style that matters and what that says about your character’s personality.
Combat from hand to hand to ranged fighting to swords has a unique science all it’s own and it requires research to understand the physical aspects of it, before we even get into the psychological side of the training.
And there is a serious psychology behind it, a character who is a professional combatant thinks differently from one who is not. The way they approach and see the world will be influenced by how much training they have and what they have been trained in. A soldier thinks differently from a spy and a spy thinks differently from an assassin (and two of these are not really combatants) and all three think differently from what a cop will prioritize or how a classically trained martial artist will approach any situation.