Adjectives use endings you already know. A first-and-second declension adjective takes second declension endings for masculine and neuter and first declension endings for feminine, so ἀγαθός, ἀγαθή, ἀγαθόν is three familiar patterns rather than a new one.
An adjective agrees with its noun in gender, number and case. That is the easy part, and it is not what this chapter is about.
What matters here is position — where the adjective sits in relation to the article — because in Greek that is not a matter of style. It changes what the sentence claims.
Attributive: inside the article-noun unit
If the adjective is immediately preceded by an article, it is modifying the noun. It describes.
τὸ πνεῦμα τὸ ἀκάθαρτον
"The unclean spirit." The article is repeated before the adjective, which is the commonest way Greek marks this, and it puts a little weight on the description.
ἐγώ εἰμι ὁ ποιμὴν ὁ καλός
"I am the good shepherd." Same construction. Not a shepherd who happens to be good, but the shepherd, the good one.
Predicate: outside it
If the adjective is not preceded by an article while the noun is, the adjective is not describing the noun. It is asserting something about it — and Greek supplies the verb to be without writing it.
μακάριοι οἱ πραεῖς
"Blessed are the meek." There is no verb on the page. μακάριοι has no article, οἱ πραεῖς has one, and that is the whole signal. It is a statement, not a description — which is why the Beatitudes land as pronouncements rather than as a list of adjectives.
The test
Is the adjective immediately preceded by an article?
Yes: attributive. It describes, and you translate it as an adjective — the good shepherd.
No, while the noun has one: predicate. It asserts, and you supply is or are — the shepherd is good.
That is the rule wherever the noun has an article, and it is worth more than it looks. A great many arguments about a verse come down to whether an adjective is describing or asserting, and the article settles it before any of the theology starts. Two things sit outside it, and both are below: an article with no noun after it at all, and a noun with no article.
Substantival: the adjective becomes the noun
Give an adjective an article and no noun at all, and it becomes a noun itself.
Look at οἱ πραεῖς again in that verse from Matthew. There is no word for people in it. The article plus a masculine plural adjective is enough: the meek ones, the meek.
You will meet this constantly. ὁ ἅγιος, the holy one. οἱ ἅγιοι, the saints. τὸ ἀγαθόν, the good — the thing that is good, neuter because it is an abstraction rather than a person.
The gender is doing real work there. Masculine plural for people, neuter singular for a quality or a thing. When you meet an article with no noun after it, read the gender first.
What to watch for
Word order alone will not tell you which position you are looking at. ὁ ἀγαθὸς ἄνθρωπος and ὁ ἄνθρωπος ὁ ἀγαθός are both attributive and both mean the good man; the adjective has moved and nothing has changed.
Where the noun has an article, the article decides and the word order does not. Look for it, not for the position on the line. Where the noun has no article, nothing decides it for you and the context is all you have — which is the same limit chapter 21 will reach with participles.