Editing text on a computer is pretty simple. You can underline a section of text with the keyboard shortcut Command (on CTRL) + U. However, on your phone, things are a little different. Since you have to deal with so many apps on your phone and no two apps work the same, editing text on these apps can be a bit of a challenge.
iPhone 12: How to Bold/Underline/Italicize/Strikethrough Text in the Notes App
If you want to underline text on your iPhone, this post will let you do so in all popular apps.
Related: How to Create, Edit, and Share Shortcuts on iPhone
Apps that rely heavily on texts in general also allow you to easily edit the textual content. For example, Apple's Pages, Numbers, Notes, Mail and Reminders apps offer a native way to apply underlines to texts. The same can also be achieved with some third-party apps: Google Docs, Sheets, Gmail, Word and Google Chat.