You mean here in the specific case of using the 'accusative' or 'dativ' after a verb.
In this case ,if the noun that follows the verb is a direct object ,then you use the 'accusative' , if it is an indirect object you will use the 'dative'.
Here are some examples to explain it :
- Ich schreibe den Brief.
Here the noun 'Brief' is a direct object , it means that the action ,the subjet does ( Ich) is directly connected to the object ,the subject (Ich) is doing the action ( schreiben) of writing what ?
(Brief) ,so obviously you will use the question 'what ?' to get the direct object of the sentence as an answer.
Was schreibst du ?
Ich schreibe den Brief.
Other examples :
Er liest das Buch
Sie hängt das Bild an die Wand.
Wir antworten die Fragen.
Here 'Buch, Bild, Fragen' all are direct objects, thus in the 'accusative' form.
- Ich gebe der Frau das Buch.
Here 'der Frau' is an indirect object ,the subject is not directly connected in action with it,
The direct object is 'das Buch' "Ich gebe das Buch' .
To whom ? is the question to get the answer 'der Frau'
Wem gibst du das Buch?
Ich gebe der Frau das Buch.
In this case you use the 'dative'.
Other examples:
- Ich danke dir sehr.
- Ich gebe dir das Buch.
- Er erzählte mir die ganze Geschichte.
Here those verbs are followed by the 'dative' , because they are indirect objects such as in 'gebe DIR' .
-Ich verstehe dich nicht.
- Ich liebe dich.
Here again it is the 'direct object' ,'dich' '
Wen?
Wen verstehst du nicht?
Wen liebst du?
In those case you use the 'accusative' form 'dich' rather than 'dir' ( the dative one).
I hope it is a bit clear by now :)