This is useful advice for non-fiction writers just starting out, who need ideas for articles and can often find inspiration in their own life and the things they would like to read about. It’s important, however, that once they have more experience, they branch out into unfamiliar territory, using research and interviews to delve into new material. Otherwise, this becomes a self-imposed limitation.
Writing what you know in fiction? Not such good advice for beginners. Look at some of the major criticisms often levelled at first-time novelists: that they’ve just written a thinly-veiled version of their own life, or that they’ve put themselves into the book as a character (a Mary-Sue). Those sins (of course, they’re only sins if they’re done badly) come from writing too much what you know.
On the other hand, writing about something you have firsthand experience of does help with authenticity and voice, so it’s not a bad basis as long as it’s not over-relied on. One technique to jump off what you know into fiction is to ask ‘what if?’. Take a real event from your own life, the world in general, a person you know, and ask what would have happened if… if the car hadn’t braked in time, if they hadn’t met in high school, if he had been born twenty years earlier, if she had taken that job offer, if he had been the violent sort…even applying this technique to one of those ‘quirky’ newspaper articles can be effective in generating a premise for a short story or novel.
You do have to back up writing what you don’t know with decent research, which is where the internet, friends who are doctors or police officers etc, and the good old library can come in handy, as well as undertaking physical experiences (like going parachuting if your main character is a paratrooper) where possible.
The point is you shouldn’t limit what you write about just because you don’t know anything about the topic: 1) there are more interesting (and less explored) possibilities in what you don’t know about yet than what you already do know about, and 2) it’s always possible to find out what you need to know to be convincing.