It's a good question, say you're running your own little blog or for your business.
Of course the question will come into mind, if not immediately, then eventually. I myself have asked this question many times, and I'll share with you what I've found.
Your journey to find out what content you should write, might actually be more straightforward than you'd think.
It all starts with people, your audience, your clients.
Writing is about helping people. When someone reads a book, it's to feed their mind, regardless of the topic. So the core question one must ask themselves when writing is:
Who do I want to help?
Hmm, maybe that's too general for you. Well then you can switch it around and ask instead:
WHAT DO I WANT TO HELP PEOPLE WITH?
Either of these questions will put you on the right track.
Say you're a tech writer, or your company is in that sector, you'd want to educate people about not just exactly what you do, but how you can help them.
Whatever you write should tie into that single goal.
It does not need to be about your product or service, nor does it need to be about something directly related to what you're providing, though that should definitely come in when you're writing a piece. Your focus should be on helping your readers better understand your industry, it's sector and how it affects them personally and what role you can play into helping them get ahead.
Even if your company cannot directly help readers in a particular subject matter, your readers will still appreciate the good read given to them, as you've armed them with information.
That's a powerful gift, information. People love gifts, but you know what people love more than gifts?
When your gift is of value, i.e the information you're giving is of value, then you need not worry about anything else, because people love value and it will support itself and build rapport with your audience.
So write, give your audience all the value you can. That's how you decide what to write.