I was asked to do an online presentation for a writing group on "My Best Writing Advice." I thought a lot about it, and I think while "Write What You Know" is good advice, I think it's more important to "Write What You Enjoy."
If you don't enjoy writing, you won't continue. Desire for money or recognition or validation can carry you only so far. (And writing only for those is, I think, a good way to be miserable.) But writing what you enjoy, then your work can give you pleasure even as you wrestle with it.