How to add a class to a link in text editor

You can use third party free WordPress plugin “Extend Link“. You can activate this plugin and add extend link as shown in below screenshot.

enter image description here

Now when you click on “Extend Link”, you will see the popup similar to default link popup but with an additional option to add IDs, Class and Rel.

enter image description here

https://wordpress.org/plugins/extend-link/

Please let me know if this helps..!!