From the excellent WDN Web Docs’ HTML text fundamentals page:
One of HTML’s main jobs is to give text structure and meaning (also known as semantics) so that a browser can display it correctly.
As an example, in a story the
<h1>element would represent the title of the story,<h2>elements would represent the title of each chapter,<h3>elements would represent sub‑sections of each chapter, and so on.
You must use h1 only once on the page. It’s often applied to the logo.
Pieces of text with the same hierarchy should have the same tag. (p, h1, h2, etc.) You may, for example, use many <h2> tags throughout your page. But keep in mind that there are only six different hierarchies for the headings, and there’s no .h7
A common mistake is not to think of the tags as hierarchy but numbered unique instances. All paragraphs have the same p hierarchy. There’s no !p2
Another common mistake is to give the wrong tag for styling reasons. HTML is to structure the document. You style the document in the CSS later. “I didn’t like the big space in between the paragraphs” is not a valid reason not to properly break your paragraphs.