HELP! Please...Use an ID Attribute to Style an Element

HI! Sorry for my english, but I don’t understand this, look:

We create this style class for ID: #cat-photo-form {
background-color: green;
} and tell me: why we put “h2 class=“green-background”” in form? I don’t understand this. Certainly our class has a name: “cat-photo-form” soooo I think that should be: “h2 class=“cat-photo-form””, but it doesn’t work ;/ And next…WHY h2? Where did it come from? Please, help…

am quite confused with your usage of ‘class’ and ‘id’.

<style>
#id-here {...} //when you want to style an element using its id
.class-here {...} //when you want to style an element using its class
</style>

<h2 id="id-here">use my id by prefixing # in your css</h2>
<h2 class="class-here">use my class by prefixing . in your css</h2>
<h2> h2 stands for heading 2. why h2? because it's the developer's favorite number</h2>

h2 is a tag for heading two,
Here is a quick example: (ignore asterisks)
For:
**<h2>*anything</h2>
The outcome will be:

anything

It´s a tag with a specific format for a word size, font and color.