Writers are often urged to write about what they know. On the face of it, that must be good advice, particularly if you want to write non-fiction.
If you have an area of expertise, you are able to write articles and even text-books. If you need further facts there are plenty of ways to research and learn more about your chosen subject.
Even if you think you have insufficient knowledge of any one subject, think again. We all know something, for example about emotions. We’ve all experienced joy, grief, surprise, fear and any other emotion known to man. We can write about any of these, and many writers do in one form or another.
Moving away from the idea of writing about what you know, where would we be without imagination? There would be few novels if we only stuck to our own experiences. We don’t expect that every crime novelist should break the law simply to be able to write their books. A writer of science-fiction has, as far as we know, never met with an alien from another planet. Although their stories must be believable, they are figments of their vivid imaginations.
So, whether you want to write fiction or non-fiction, it’s entirely up to you and your knowledge and creative mind.