In those cases, you cannot accept an answer. A comment is not an answer, so you cannot mark a comment as accepted.
Instead, I recommend you do one of two things:
Write an answer yourself that answers the question (incorporating the insights from the comment). Then, mark it as accepted. This ensures that others who come across your question have a nice, clean answer. Or, you can encourage the person who wrote the comment to turn it into an answer. Generally, if they haven't done that after a day or two, you are welcome to turn it into an answer yourself.
Alternatively, you can do nothing, and don't accept any answer. That is also OK. It won't create a negative impact on your reputation. We won't judge you by this.
In general, if there is an answer that helped you the most, marking it as acceptable is helpful. It is the best way to say "thank you" to the answerer, and doing so gives both you and the answerer a small reputation bonus (you gain +2 reputation for taking the time to mark an answer as accepted, and the answerer gains +15 reputation for writing an answer that was so helpful to you). It also pushes that answer to the top and thus helps anyone else who may have the same question: if they come across your question, the first answer they see will be the one you mark as accepted.
See also https://cs.stackexchange.com/help/accepted-answer