The main problem with writing what you know is that what most people know is boring.
You know your job, your town, your family, your friends. You know your experiences, which, on the whole, are probably pretty ordinary. The purpose of fiction is to take the reader away from the ordinary, or to take the ordinary and to somehow make it seem extraordinary. As long as you write only what you know, you cannot achieve that.
The second problem with writing what you know is that it's limiting.
When I lived in Atlanta, I critiqued a lot of first attempts from local writers. Inevitably, they would set their books in Atlanta. More importantly, the setting rarely, if ever, influenced the story. The book could have taken place anywhere, but because these writers were writing what they knew, they were very careful to make sure to describe every stop light on Peachtree Street, every intersection on Piedmont, and no one cared. Boring. More importantly, because they were so circumscribed by the real life boundaries of their setting, they missed opportunities to move their stories forward or make them interesting. A gunman can't burst out of the bank on the corner if there is no bank on the corner, and adhering so closely to the truth of what they knew stifled the imagination of the writer who otherwise might have simply invented a bank and put it there.
My Raine Stockton series is virtually set in the small mountain town where I live. Many of the incidents portrayed in the books are based on local newspaper headlines. However, I made a conscious decision at the beginning to move the setting some thirty miles north, in a fictional town in a different state, even though it meant I'd have to do some research to get certain facts about the law enforcement community there straight. I'll be the first to admit I didn't get every detail right. But sometimes it's good not to know what you don't know. Exploring the unknown, asking the questions and sometimes even making up my own answers freed up my imagination to breathe life into the story. I was able to surprise myself-- and my readers-- with the unexpected. Had I adhered literally to the town I know so well-- the people who recognize me on the street, the businesses and services that do and do not exist-- I would have been constantly looking over my shoulder, pursued by voices that whispered in my head, "That could never happen" or "He would never do that" or "I hope she doesn't recognize herself". It would have been a disaster.
On the subject of basing your characters on someone you know-- even yourself-- here is my advice: Don't do it. Ever. Please. The moment you put yourself or incidents from your life into a novel, your mother is going to be reading over your shoulder, literally or figuratively, every word you write. You cannot help censoring yourself. Your story will be shackled to the truth-- or worse, a soft-bellied blurred-eyed version of it--from beginning to end. When you base your character on someone you know, no matter how fascinating a life he may have lived, you will always be bound by your vision of that person, and limited by your understanding of him. Instead of asking yourself what your character would do, think or feel, you will be asking yourself how the real person, as you knew him, would react. Two problems with that: 1) you don't know the answer. 2) You will be too inhibited by your perception of the real person-- or perhaps by his reaction to your portrayal-- to make something up. The only person who knows the soul of a character the way that you, the author, need to know it is his creator. So create.
You've heard the expression, "A little knowledge is a dangerous thing". Too much knowledge can be even more dangerous, especially when forced upon the unsuspecting-- and generally disinterested-- reader. The medical doctor who describes his fictional surgery in the kind of technical detail generally reserved for training interns. The retired detective who takes the reader through twenty-two pages of questioning a suspect-- only to discover that the subject of his interview isn't involved in the case after all. Of course that's how it happens in real life. But the writer who believes he's doing his readers a favor by enlightening them, in exhaustive detail, with his unique expertise is usually just deluding himself.
By all means, every writer should use her own experience, background and perspective to add color and verisimilitude to her story. Embellish with details that ring true. Use your particular insight into little-known subjects to surprise and inform readers, or even to take your plot in a direction another writer would not have considered. But don't get so bogged down by what you know that you neglect to imagine.
When I started my mystery series I brought to the table what I believed to be a unique insight into dog training, dog sports and dog behavior. I used what I knew to add a sense of realism to the stories, and to give readers a glimpse of a world they might not otherwise see. What I did not know was anything at all about search and rescue, small town law enforcement, or working for the forest service--and those were the pillars on which the series was built. Learning about these things, and using what I learned to enhance the world I'd already created, gave the books a sense of immediacy and energy I couldn't otherwise have achieved. And even though the books are written in the first person, the only thing the main character and I have in common is a golden retriever. She doesn't even remind me of anyone I know. Because of this, she lives her own life, makes her own choices and participates in her own growth independent of any restrictions or expectations I might place on her. And for thousands of readers across the globe, she has become as real as the girl next door.
Instead of advising new writers to write what they know, I suggest they get excited about what they don't know. Write about what you want to know, places you'd like to go, life as you wish it could be. Let curiosity and imagination take you on a journey of discovery and your reader will automatically be swept along with you. And, for heaven's sake-- in the words of the late, great Mark Twain-- never let the truth stand in the way of a good story.