Guten Tag sfpugh,
thank you for your question!
Generally da-compounds replace a pronoun that is used with a preposition and refers to an inanimate object or idea, for example:
“Meine Kindheit war schön. Ich erinnere mich gerne daran." - “My childhood was nice. I happily remember it.”
Usually we would just use a pronoun to refer to a noun which was mentioned in a previous sentence. But it would be incorrect to say “Meine Kindheit war schön. Ich erinnere mich gerne an sie.” because we are talking about an inanimate object/experience. This is why we have to use daran.
If we were referring to a person, a preposition + pronoun would be perfectly fine, for example:
“Meine Oma hieß Sophie. Ich erinnere mich gerne an sie.” - “My grandmother was called Sophie. I happily remember her .”
The other way you can use da-compounds is to refer to an entire clause:
“Ich erinnere mich gerne daran, wie ich mit meiner Oma im Garten gespielt habe.” - “I remember happily how I played with my grandmother in the garden.”
Daran refers to to the entire clause after the comma. This is also called an anticipary da-compound. These are used with a prepositional verb, e.g. “zweifeln an” - “to doubt”.
Note that you have to add “r” as in dar– when the preposition begins with a vowel (e.g. “daran”).
Let's have a look at another example:
"Es ist bald Sommer. Ich freue mich darauf." - “It's summer soon. I am looking forward to it.” or “Ich freue mich darauf, dass bald Sommer ist.” - “I am looking forward (to the fact) that it's summer soon.”
Here we have the prepositional verb “freuen auf” so we need to use the da-compound “darauf”.
I hope this helps. Let me know if you have any more questions!