Class Attribute vs. Style Rule

What is the significance of setting a color “class attribute” rather than setting the style rule to have and element a certain color? Is it just another alternative?

Can you explain/give an example of what you mean by that?

I actually found the answer to my question! Thank you for your response though.
I was trying to ask about changing the color of font. The lesson shows you first how to change and individual elements color, then how to set a ‘style rule’ to make all elements a specified color, and finally to set a class attribute for a font color. I now understand a class attribute for a color is much like the style rule, where you go h2 { color: purple; } however the class attribute is like a tag that allows you to set different elements of your choice to that color so long that you ‘tag’ it. ex: .red-text {color: red;} and then I go into my elements’ tags and simply type in class=“red text”