For (off-topic) questions
Whenever it's possible, try to suggest a way that the question could be fixed to be on-topic. This could be by:
Suggesting an alternate way of phrasing the question.
Suggesting another place where the question would be on-topic (The Workplace, parenting, etc...).
Specifying that OP can try to edit the question to make it on-topic.
Explanation: When someone asks a question, most of the time, they just want an answer and don't really care about the how. If you tell them that they can't ask their question here, they will be upset. However, if you give them a way to ask their question, they will be far less so. That's why suggestion an alternate phrasing or a place where they can ask is important.
In the case where you can't find another phrasing and don't know a place where the question could be asked, you can always tell them that, if they find a way to edit the question to make it on-topic, it won't be close/will be reopened. Since this requires much more work from OP's part, it's (far) less helpful, especially when OP doesn't know how to make their question on-topic. However, it's still better than just telling them that their question is gonna get closed.
Just saying that their question is gonna get closed can sometimes be interpreted as "You can't ask your question here, we don't want to help you".
Editing instead of leaving a comment
If you see a way that an otherwise off-topic question can be salvaged by a non-critical edit (for example changing the phrasing of the question), then go ahead and do that edit yourself. Don't forget to leave a comment explaining what you did and why you did it, and show the OP that they can revert back the edit if they so wish.