Comments are used in programs to add explanatory notes, descriptions, or reminders within the code. They are ignored by the compiler or interpreter and do not affect the execution of the program. Comments improve code readability, help document the logic, and provide clarity for future developers or collaborators. They are also useful for debugging and testing, as developers can temporarily disable parts of the code by commenting them out.