As Artem Kaznatcheev notes, comments on Stack Exchange sites are really designed to be an ephemeral "scratchpad" for improving questions and answers. They provide very limited markup options, they're not searchable (using the internal SE search; Google and other external search engines do index some of them), and they're subject to deletion at any time for any or no reason.
The idea is that, once the question has been solved through discussion in the comments, the solution should be written up as an answer (or incorporated into an existing answer), crediting the contributors to the discussion as needed. At that point, the "scratchpad" comments are no longer needed, and may be deleted.
No, it doesn't always work that way in practice, but that's the way it's designed to work.
One thing you can do, to try and get a little closer to the ideal, is to occasionally go over your old answers and see if any of them have comments (written by you or someone else) that add value to the answer. If you spot any, edit the answer to incorporate the information directly into it (with appropriate credit, as needed). This ensures that, even if the comments are later deleted, the useful information in them will not be lost.
You can also go over your old comments (available in your user profile, under "activity" → "comments") and see if any of them might be usefully turned into edits or stand-alone answers. Also, if any questions you've asked have been effectively answered via comments, you can either summarize the conclusions into a self-answer (again, with appropriate credit, of course) or just ask the user who posted the most useful comment(s) to turn them into an answer.
In some cases, once the comments have been turned or edited into answers, you may also want to delete them (if they're yours) or flag them as obsolete (if not) immediately. However, that's completely optional.