Problems regarding Understanding a very basic thing

Hi i’ve just started learning basic html & I have trouble understanding anchor links .
Below is an example of an internal anchor link and its target element:

<a href="#contacts-header">Contacts</a>
<h2 id="contacts-header">Contacts</h2>

Why did h2 come here?
and what this following text trying to say is out of my reach.
Then add an id attribute with a value of footer to the <footer> element at the bottom of the page.
basically all my problems involve id attributes.
Please explain in a better way i clicked on help but could not understand what it was trying to say.

The lesson is showing an example of an internal link. In the example there is probably a navigation bar at the top of the page and it contains a link to “Contacts”. When the user clicks that link they will be brought to that section of the page called “Contacts” and that just happens to be an h2 element.

The lesson wants you to do the same thing but you’ll be going to the footer element.

Maybe an explanation of terms will help…

HTML tags vs elements vs attributes

HTML tags

Tags are used to mark up the start and end of an HTML element. The following are paragraph tags.

HTML elements

An element in HTML represents some kind of structure or semantics and generally consists of a start tag, content, and an end tag. The following is a paragraph element:
<p>This is the content of the paragraph element.</p>

HTML attributes

An attribute defines a property for an element, consists of an attribute/value pair, and appears within the element’s start tag. An element’s start tag may contain any number of space separated attribute/value pairs.
The most popular misuse of the term “tag” is referring to alt attributes as “alt tags”. There is no such thing in HTML. alt is an attribute, not a tag.
<img src="foobar.gif" alt="A foo can be balanced on a bar by placing its fubar on the bar's foobar.">

Hope that helps.

Edit: on a side note since there are a lot of lessons and we don’t have them memorized it’s easier for everyone if in the future;

If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.