In Drupal, it is straightforward to add no-follow to Drupal comment links. All you need to do is select a checkbox for a text editor. Below steps are tested for Drupal 9.
Step 1: Navigate to Configuration -> Text Formats and Editors
Step 2: Click on Configure for Editor you have provided to the comment to Guest. In my case, I have provided Basic Editor.
Step 3: Scroll to the bottom. You will find Filter Settings. Here in Tab Limit, allowed HTML tags and correct faulty HTML select checkbox Add rel="nofollow" to all links
Step 4: Click on Save Configuration
Step 5: Verify Link contains no follow by adding a comment by selecting a basic editor. you will see rel="nofllow"
<a href="https://www.programsbuzz.com" rel="nofollow">test link</a>