Know your s**t!
I have a minor rant for writers. Please KNOW what you're writing, or find someone to guide you who does. The most egregious offenders of this are people who have never served in the military yet try to write dialogue, military character interactions, weapons, etc. It may not appear so from the outside, but military life is incredibly nuanced compared to the civilian world.
Now this also applies to other professions, such as lawyers and courtroom dramas, the FBI or police investigating crimes... I could go on down the list but you get my drift and I'm here mainly to talk about writing the military.
Let me sidetrack with some food for thought for you. There are roughly 12 million men and women in the US who are either veterans or active duty. Add in their immediate families and we're likely in the 30-40 million range of people who know more about the military than people who haven't served or been around the life. Of those 30-40 million pairs of eyeballs many will groan and shake their heads when they see something so wrong it literally spoils the book for them. If you think I'm kidding, find some veterans and have a chat with them about the many books, movies and TV shows that feature the military.
Now, maybe you have a GREAT book, but if there are that many people turned off by what is to them glaring errors, those people will talk. Word of mouth can make or break a book or anything else.
Let's look at one example from the great Aaron Sorkin. The film A Few Good Men. Here you've got to not only get the average military interaction and way of life correct, you've also got a courtroom drama with the added twist of it being a military courts martial. So many opportunities existed for the writers to completely screw the pooch, but other than some literary license with Tom Cruise's character, they nailed it. It felt genuine.
Is Aaron Sorkin a vet? I've got no idea, but I'll bet you he had some knowledgeable and experienced people vetting every word of that script.
I understand the average writer doesn't have the resources to hire consultants and experts, but that doesn't mean there aren't a TON of retired men and women out there who would be happy to chime in if you just asked. And I'm not just talking military.
Crime thriller? Find a retired cop or FBI agent to chat up
Legal thriller? Find a retired lawyer with some time on their hands
The list goes on and on.
(Side note - when you talk to these people, listen to their stories. You'll likely hear some amazing things that can be incorporated into your book or even be the foundation for another one)
So, do yourself a favor. When writing about something you haven't personally lived, seek out someone who has been there and done that and pick their brains. Most of them you ask will be honored and enjoy the opportunity and, who knows, you might just make some new friends.