The nominative case is used to refer to who/what is doing the action, whilst the accusative case is used to refer to who/what the action is done to.
Take for example the following sentence:
Die Frau liest ein Buch. (The woman reads a book)
In this sentence, ‘Die Frau’ is doing the action, so she is in the nominative case. Additionally, ‘ein Buch’ is being read, so the book is in the accusative case.
Top tip:
A handy way to remember the difference between the two is to break down the words. ‘Accusative’ contains the word ‘accuse’, so it is always what is having action taken against it. Think of it as a court case, the ‘accused’ party is the party that is subject to action, the same way an accusative word is a word that is having an action done to it.