Take for example the age-old mantra: write what you know (or, as I've seen it twisted around and presented more accurately: know what you write). It sounds simple and is good advice - as far as it goes. But combine it with another directive that I believe in - diversity is good - and there's some obvious conflict. Can you ever really know someone who is very different from yourself? Many would say no - in fact, many of those who champion diversity often point out that the privileged can never really understand what it's like to be in the minority. So if you can't know what it's like to be in a disadvantaged group unless you're part of it, how are you supposed to write about it?
It's a specific question with more general undertones. When we write, our stories have to include more than just ourselves, whoever we are. We write about people with different jobs, different genders, different ages, different worlds. We can't know everything about everything, so we have to simplify the task and know what we need to know.
One thing that means to me is that it's not necessary to know the entire group. Because any group is made up of individuals, and those individuals all have different experiences. There isn't a single answer to the question of what is it like to be a person of color in America. Is that urban city America? Rural Midwest America? Middle class America? Future post-apocalypse America? There are so many other variables in any story that any character you create should be a different person from anyone who actually exists, therefore the character's truth is different from any real truth.
This does't absolve you from research. If you are writing about someone/something different, you need to research the subject and get some understanding going. But it does mean that you don't have to because an expert in every aspect and you can extrapolate. You can take one person's account and build off it. I've found that to be important because I can usually find a few good information sources, whether it's from specific individuals or reading personal accounts, that relate to my story/character. A small number of personal stories cannot represent a whole people, but it's okay, it doesn't have to. Anyone who says otherwise has an agenda besides creating good stories.
The amount of research, the breadth and depth of your knowledge, should also be dictated by the needs of the story. If you're a white male living in suburbia and you want your main character to be a Hispanic transgender farm worker, then you're doing to need to do a hell of a lot of research, both into the groups of people your story will have to include, and also deep into the psyche of such a person who your readers will get to know real well. But if you're a twenty-something lesbian writing about a college kid who has a brief run in with the law before straightening out her life and falling in love, you probably don't need to delve quite so deep into the realities of being a police officer - but you should do enough to make sure that minor character acts in a believable way.
For me, I know I have limited experience. But I have crossed paths with quite a few people over the years. I also try to read a lot - biographies are a great way to learn about a person. I look at everyone I meet, and every character I create, as an individual with a story that's very important and meaningful to them. The more I understand that one person in front of me (even if it's only electronically), the more I can translate that into a real person on my page. I'm sure I will never know what it's like to be a transgender farm worker, but I can know what it's like to be an outcast, or to hide a secret, or to be confident about my differences, or to find someone who loves me just as I am. And I can try my best to learn what those things are like for someone else. Putting it all together, I write what I know and try to create a diverse and realistic world, full of individuals with their own truths. One character at a time.