Detailed answer
Give the destination a unique id and use it as the link fragment.
Fragments work within the current page or after another page's path. Stable IDs preserve incoming links when headings are edited. A fixed header may need scroll-margin styling so the heading remains visible after navigation.
Example
<a href="#forms">Go to forms</a>
<h2 id="forms">HTML forms</h2>
Understanding the behavior
A fragment points to an element with a matching id in the target document. The destination must exist and use a unique identifier. A link to another page can also include a fragment after its path.
Practical implementation notes
Test the complete URL directly, not only by clicking from the current page. If a sticky header covers the target heading, use a suitable CSS scroll margin rather than inserting empty anchor elements.
How to check it
Follow the fragment and check the destination id, including any fixed-header offset.
Expected result
The intended section remains reachable through a stable identifier.
Watch out: Changing visible heading text does not automatically update its id.
Read the reference ↗