Noun or adj

I have read a sentence in a book:
With despairing eyes, he stare at the coldness of the walls.
So, “despairing” is noun, it modify for the word “eyes”.
But, why do we not use an adjective to modify Noun?

‘despairing’ is used as an adjective there.

The sentence you read should have been ‘he stares at…’

It’s not always necessary that you should use an adjective to modify/qualify a noun. Even a noun can undertake that function. Modern grammar explains it. Look at this example:
Shakespeare plays. Here you will find that both the words are nouns. But, in fact, ‘Shakespeare’ does not function as a noun in this case, but as an adjective which the grammarians call a ‘CLASSIFIER’, a prenominal (an adjective).

If you look up a dictionary like Oxford, despairing is NOT a noun, It’s an Adjective.
With every day that passed he became even more despairing.
It’s just an adj like interesting, Exciting. I think you identified them mistakenly as gerund (The verb has -ing form and functions as noun).
As Anglophile said, you can also use noun to modify a noun, not necessary to use adj.

Ok. But what is different between: using noun to modify a noun and using adj to modify a noun? What kind of meaning do they modify?
Some words have their noun and adj, so what word do we should use?

It’s up to what meaning you intent to express. Using the noun or adj to modify has different meaning.

We stock a wide range of beauty products
It’s a beautiful product.

beauty products = “kind of cosmetic products, lipsticks…” - a lipstick is a kind of beauty products.
beautiful product = “the design/outlook of product is beautiful”

They do not have the same meaning when you use noun/ adjective to modify.

Beauty products > Noun + Noun. The first noun is an adjective that refers to the whole class of products used for beautification. Here ‘Beauty’ is a ‘CLASSIFIER’.

Beautiful products > Adjective + Noun. The adjective tells us that the products we mean (any products including cosmetics) are beautiful. Here ‘Beautiful’ is also called a ‘QUALIFIER’.

***** NOT A TEACHER *****

That is actually a very good question!

I made a grammar mistake. (“Grammar” is a noun that modifies “mistake.” That is, a mistake in grammar.)

I made a grammatical mistake. (“Grammatical” is an adjective that modifies “mistake.” That is, my mistake is an example of improper grammar.)

I have noticed that most experts say that both sentences mean the same.

I have also noticed that some experts do not like the second sentence. They ask: How can a mistake in grammar be “grammatical”?