Gathering the correct terminology is best.
I've written something that had a cop as the main character and took place in a real city. My first course of action was to go to the city's police station website and look to see what type of gear they used (for some reason this information was readily available with little digging). Then I would look at that police department's radio codes and their meaning. This is normally the same for all cities in a state.
You also have to try and nail their attitudes, even if that attitude derived from a caricature or stereotype. Sometimes certain stereotypes are just facts, and acceptable. Writing a story revolving around special forces basic training? You're of course going to have a foul-mouthed drill instructor. On the other hand you'll have the wimps that elect to give up during training (which typically has some sort of ritual. Navy Seal training has a bell that is rung by the person quitting.)
Avoid generic sounding terms such as "machine gun", "pistol" and "grenade." Most people in special forces don't have machine guns (regardless what the media says, but that's beside the point). Get the proper names for your weaponry, and their slang names as well. You'll find that cops, along with military have their own language. I've even been critiqued to the point where the person doing the reading said they didn't understand when an older officer called a first year officer "rook." Obviously that means rookie...shouldn't have to explain something like that, but you might have to, so be aware of that.
EDIT: Almost forgot, if you lay the military lingo on in a thick way, make sure you're consistent. You wouldn't want to show one character doing something by the book, then have another, yet equally experienced, character doing something different in an amateurish way.