Be concise, factual, polite, clear and sincere all at once
I don't believe there is a single correct way to write a comment on this site. The help centre advice on comments tells us how and when to comment but not what to comment.
Welcoming a new user
I think informing new users of our standards is an important part of the Stack Exchange model. This is one of the main reasons I use comments. The typical structure I use for these comments is below.
Welcome to {site}.se! Take the [tour] and visit the [help] when you get a chance. {Relevant message about their post} Thanks for participating and happy {site specific activity}!
In the message I like to compliment what they have done well in the post and provide polite advice for things they can improve. Sometimes I will edit their post and explain why I did. The goal is to make our new users feel welcome and grow our communities.
Explaining a close vote
When you vote to close you can choose from a number of predefined reasons. If you choose 'other' you are given a prompt to comment with:
I am voting to close this as {category} because {reason}
If the reason you are voting to close can be easily explained using this format then it is a good idea to do so. The important part of these comments is to make it clear what the OP needs to do to reverse your vote. "I'm happy to reopen this once you clarify X" sort of thing. Be clear and polite in your feedback and try to encourage the OP to fix the post rather than abandon it.
When closing a question as a duplicate remind them that duplicates are a good thing, as they help users find the original question.
Explaining downvotes
Much the same as explaining close votes, be clear about what your issue with the post is. If possible try to provide a suggestion for how it can be improved.
Requesting more information/clarification
A clearly worded well written question is plenty for this type of comment. Try to ensure the OP will understand what you are asking, never assume they have all the information you do. They are coming to Stack Exchange to ask the experts for help after all. Also providing a reason to why the information is useful can help. Many posters don't understand why they need to provide that particular piece of context.
Suggesting an improvement
The key to this type of comment is to take the tone of "this is good, but it can be great", rather than "this is bad, take my advice to be less rubbish". An example of this kind of comment is below.
This is a pretty good answer, however I don't quite understand the second paragraph. Perhaps you could add an example of how this would work?
General Tips
These tips apply to all comments on stack exchange sites.
- Avoid sarcasm. This one is important, it rarely comes across well in text. What you thought was hilarious someone else saw as offensive. Just avoid the issue entirely by not using it.
- Be nice. This is site policy and failure to do so will definitely get your comment removed.
- Be constructive. Only use comments to comment on the content of the post and how it can be improved. If you simply dislike it or disagree use your downvote accordingly. Sometimes you can add a well structured criticism of their post if you believe that less qualified people may not understand the issues with it. How to write these is beyond the scope of this answer though.
- Use links to support your points. Adding links to related questions, articles, meta posts and help centre pages can give your comment more weight.
- Write more in less comments. Use the least amount of comments where possible. A chain of 3-4 comments on a post is likely to get removed. Whereas 1-2 useful comments will get upvoted and remain. If you need to discuss something with the OP invite them to chat.