Any German adverb/adjective, for example gut, appears identically whether used as an adjective (meaning "good") or as an adverb (meaning “well” or "in a good way"). Often you have to decide from context how the German word is functioning—unless it is an adjective modifying a noun. That case is simpler: as you learned above, it then must have the appropriate adjective ending. This is crucial for you to learn how to use for determining whether a word is being used adverbially or adjectivally within noun phrases. Adverbs, of course, never have an adjective ending.
Der gute, dicke Kuchen schmeckt.
The good, thick cake is tasty.
In the above example, the presence of the endings on both gut and dick reveal that they are both adjectives which modify the noun Kuchen.
Der gut dicke Kuchen schmeckt.
The nicely thick cake is tasty.
In the above example, the lack of any ending on gut and its position relative to the words around it reveal that it is an adverb which modifies the adjective dick. It cannot possibly be an adjective modifying the noun Kuchen because it lacks the ending which would have been required. And the position of gut inside the noun phrase for Kuchen clarifies that it modifies dick, as opposed to modifying the main verb of the entire sentence as it would if it were located outside the noun phrase. And yes, the presence or absence of that comma can be a helpful clue, as well.
However, it is possible for German adjectives to appear without any endings. Like in English, an adjective can be the predicate of a statement with the verb "to be." In German, then, the adjective would take no ending, since it is not modifying a particular noun. Example:
Das ist gut.
That is good.