A lot of the times, in projects, you're writing to yourself, or more precisely to your future self, so that you can figure out in the future what it was you were trying to do in the present. If you've ever come across one of your past projects, and have no idea what it was supposed to do, or where you stopped working on it - that's where a document addressed to yourself would have been invaluable.
If you're writing for some other audience, then it's most important - assuming you want them to read your writing - to try to see the world through their eyes. Technical writing should generally be gradually incremental, starting from minimal assumptions of the audience's knowledge and working upwards. Then, they can read along for awhile at least before having to jump off the train. I recently came across an excellent example of this approach:
https://www.scottaaronson.com/papers/pnp.pdf
As far as non-technical writing, anything goes, be creative, you could be the next James Joyce, which AI is unlikely to ever replicate, or at least probably not.