This advice will cripple you; don’t listen to it, don’t look at it, don’t think about it!
Now, I should qualify this advice does have its place, but it should be taken with a pinch of salt; I’d take it to mean don’t write about something sensitive or realistic until you’ve taken the time to research it. Likewise, don’t take experiences that are no yours. i.e. write about people of different cultures, colours, orientations, and genders, but don’t write a story about the experience of being that person. Have a gay character, but don’t, as a straight person, write about the experience of being gay in this world. Makes sense, right?
Don’t, dear god, think it means don’t write about anything unless you’ve first seen/done/experienced it! Because you’ll either spend your life chasing questionable experiences, or your writing will suffer.
Writing is the practice of literacy tempered by empathy; if you don’t have direct experience talk to those who do, read primary sources, do your research and draw on similar experiences that you do have.
Above and beyond all else you need to learn to take criticism from the people who do know what you’re writing about first hand; don’t take it as a personal attack, but an opportunity for personal growth. If you practice these disciplines, research, active listening, empathy, and humility, your writing will flourish!