Most of our job-related writings are dialogues. We are talking with our colleagues through email, Slack or even code reviews. That means it is expected from us to follow the same rules of etiquette of in-person conversations.
It is easy to forget that with exchanges that happen remotely, asynchronously and in the written form. There are simple things you add to your text that make a lot of difference in the tone of your message.
When asking for something, say “please”. When receiving something, say “thank you”. When you make a mistake, say “sorry”. Do not skip good manners you know since you were nine years old with the excuse that you want to be objective and go straight to the point. These are never mutually exclusive.
On emails and chats, if you are starting an exchange, use "Hello, how are you?". Adjust to the expected level of formality and keep it simple, but always add a greeting and a farewell. A good farewell - or valediction, a word that I just learned - is "thank you". A lot of our communication is about helping each other, so it is a proper farewell more often than not.
Another polite thing to do is to ask about other subjects that are not the primary topic of that conversation. Ask follow-up questions of issues from other conversations you had with that person. It shows you remember, it shows that you care and creates an opportunity for more help. Things like "What about that doubt with the API documentation, did you solve it? Do you still need help with that?".
Just be sure to stay away from personal and private subjects. These are inappropriate even if it is a very close colleague. Even if it is a rather light, non-controversy topic like "How is your family?". If there is enough intimacy in the relationship that allows for this kind of questions, they should be done on in-person conversations. This is the limit where written conversations stop mimicking in-person ones.
The general advice is to understand when a text is akin to a conversation and when it is not. Essays, commit messages, pull request descriptions and code documentation are not conversations. Keep them dry, technical, and impersonal. Emails, chat messages and comments on code reviews are conversations. Keep them personal, human, and following the rules of etiquette of your social group.