The three de's at a glance
的 is the most common. It appears between a modifier and a noun: 红色的苹果 (red apple), 我的朋友 (my friend). 得 appears after a verb, before a complement describing how the verb was performed or to what degree: 他跑得很快 (he runs very fast), 她说得清楚 (she speaks clearly). 地 appears after an adjective used adverbially, before a verb: 认真地学习 (study seriously), 慢慢地走 (walk slowly).
Rule 1: 的 modifies nouns
Anything before 的 is describing the noun after 的. The noun is the head; 的 is the link. 贵的手机 (expensive phone), 我买的车 (the car I bought), 红色的苹果 (red apple). If the modifier is a monosyllabic adjective describing an inherent quality, you can sometimes drop 的 (好人 = good person), but for emphasis or longer modifiers, 的 is required.
这是一本非常有意思的书。
Zhè shì yī běn fēicháng yǒuyìsi de shū.
This is a very interesting book.
Rule 2: 得 introduces verb complements
Verb + 得 + complement tells you how or how well the verb is performed. 他写字写得很漂亮 (his handwriting is very pretty). The complement can be an adjective, another verb phrase, or an extent phrase. 得 always sits right after the verb, not the object. If you name the object, the verb repeats: 她说中文说得很流利 (she speaks Chinese fluently).
他跑得很快。
Tā pǎo de hěn kuài.
He runs very fast.
Rule 3: 地 makes adjectives into adverbs
Adjective + 地 + verb produces an adverbial modifier of manner. 认真地听讲 (listen attentively), 开心地笑 (laugh happily). 地 sits before the verb. With monosyllabic adjectives 地 often becomes optional; with two-syllable adjectives it is expected. In many textbooks, the 地 of manner is presented alongside bare adverbs (很, 非常) but the two grammars are different: 很 is a pure intensifier, 地 creates a manner adverb.
How to decide which 的/得/地 to use
Ask: is there a noun after it? Use 的. Is there a verb before it and the complement describes that verb? Use 得. Is there a verb after it and the word before describes how? Use 地. In modern informal writing and text messages, Chinese speakers sometimes merge all three into 的, but in formal writing and exams the distinction is strict. HSK expects you to use the correct character.
Common mistakes
Error 1: 他跑的快 — wrong; the complement follows a verb, so it must be 得: 他跑得快. Error 2: 认真的学习 — wrong when meant as an adverb; this reads as "serious studying" (noun phrase). For "study seriously" use 认真地学习. Error 3: 漂亮得花 — wrong; the complement is wrong position for 得 and this should be 漂亮的花 (beautiful flower). Context tells you which 的/得/地 fits.