You use the dative case for the indirect object in a sentence.
The indirect object is the person or thing to or for whom something is done.
To make it clearer, let's analyse this English sentence:
So now, you need to ask yourself the questions:
Who sent the present?
What is the pupil giving?
To whom is she giving it?
The pupil. So the pupil is the subject (nominative).
The present. So the present is the direct object (accusative).
To the teacher. So the teacher is the indirect object (dative).
Here are some German examples:
Who sent the email?
What did I send?
To whom did I send it?
Ich, so I is the subject.
eine E-Mail, so an email is the direct object.
meiner Freundin, so my friend is the indirect object and in the dative.
Who told the story?
What did he tell?
To whom did he tell it?
Er, so he is the subject.
eine Geschichte, so a story is the direct object.
seinem Bruder, so a his brother is the indirect object.
There are several verbs that are always used with the dative. Here are the most common ones.
The verb danken takes the dative, so meiner Oma is in the dative case.
The form hilft is from the verb helfen which takes the dative, so seinem Vater is in the dative case.