The legacy method of underlining in HTML is to use tags, but the modern CSS-based method is now used. Underlining is considered a bad way to draw attention to text because it is easy to confuse underlined text with a link.
Steps
Method 1 of 2: Modern Method

Step 1. Use the "text-decoration" property in CSS
Currently, the tag is not used to underline text.
By adding this property, you don't have to change your code in the future when old tags go out of circulation

Step 2. Use a tag to underline a specific piece of text
Enter a start tag along with the "text-decoration" property in front of the text you want to underline. At the end of the text, enter an end tag.
This text will be underlined.

Step 3. Specify HTML elements in the section to make it easier to underline
It can also be done using a CSS stylesheet. For example, to underline all level 3 headings, add the following code to the "style" section:
This heading will be underlined

Step 4. Create a CSS class to quickly underline text
You can create classes in a style sheet or section to call them later. The class can be given any name.
Use this class to quickly underline various elements

Step 5. Think of other ways to highlight the text
We recommend that you avoid underlining to avoid confusing users. Better to use a tag to make the text italic. Use CSS to add other styling options to this tag.
Anything in the "em" element will be italicized (default) and also colored red thanks to the additional styling options.
Method 2 of 2: Legacy Method

Step 1. Avoid using old tags
They are deprecated, which means that these tags still work, but are being discouraged or discouraged. This is because HTML is not meant to customize the style of content. The tag still works, but must represent text that is different from other text, such as misspelled words or Chinese proper names.

Step 2. Use tags to underline elements (for demonstration only)
There is hardly a single case where you need to use these tags. You may need to edit the old site, so it's best to be aware of what these tags are.
Old HTML tag allows you to quickly underline elements , but if other elements of the style were touched, everything became chaotic. Therefore, nowadays they use the "text-decoration" CSS element for underlining.