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>
Wed, 02/22/2023 - 21:47
Tarun Goswami is a highly experienced professional, currently serving as Technical Lead at a well-established IT services company. With over 12 years of experience across multiple domains, he demonstrates his expertise and passion for the industry through his engaging and informative blog writing in his spare time.
Comments