Beginning writers are often advised to write what they know.
Personally, I've always considered that rather limiting advice. Granted all of us have experiences which we might utilize in our writing. But is your experience broad enough to justify a novel? And should a good novel be autobiographical?
A good writer should have curiosity and imagination, two traits which go beyond mere experience. Not that I'm opposed to experience. I believe experience to be a great teacher--if you're willing to learn from it.
But I prefer to believe a writer should write what he wants to know.
As E. L. Doctorow put it, "Writing is an exploration. You start from nothing and learn as you go."
This desire to learn has the power to stimulate your imagination and take you places you've never experienced before, a voyage which can transform your writing and give it a power it might otherwise lack. Your enthusiasm for the subject should shine through and transfer to the potential reader what you've learned about a subject.
For me, research is half the fun of writing and provides opportunity to delve into many fascinating topics. But we need to beware of lecturing to our readers. What you've learned about a particular subject must conform to the story you're telling and contribute to the advancement of the plot. It may please you to elaborate on a particular theme and this is where you need to exercise care lest you stall your story and leave your readers exasperated.
Read Hemingway's story Big Two-Hearted River. One of the things I initially liked about the story when I read it as a boy was all it had to say about the pleasures of fishing. The story isn't about fishing. But there's a lot of fishing in it, which gave me pleasure and also taught me a few things both about fishing and writing.
A powder mill is an essential element in my first novel, Schlussel's Woman, and I read extensively on the process to understand how powder is manufactured. But, in the novel, millworker Isaac Inch's explanation of the process to the artist Titus Kuhns is kept to less than half a dozen paragraphs spread over several pages. My intent was to provide the reader with just enough to understand its importance to the plot.
As with description, a writer should introduce what's been learned in gradual, digestible supplements to his prose. It's the old premise of show, not tell (though there are instances where tell is appropriate).