Many European languages are built on cases that represent the function a noun performs in a given sentence. Among the two, three or more cases languages have, the most important distinction is between the subject (also known grammatically as the "nominative case") and the object (also known as "accusative case") of a sentence.
Let's consider some examples.
Ich (subject) kaufe ein Buch (object).
I buy a book.
Ich (I) is the subject (i.e. the "doer" of the action and the entity that the sentence revolves around), while the "Buch" (book) is the noun that has the action of buying being done to it (that is, the receiver of the action). Most sentences require both subject and object because otherwise sentences are very simple.
Of course, this logic doesn't just apply to the subject-object distinction "in real life", as it were, but also to people acting on people, as the example below illustrates.
Sie (subject) ruft ihn (object) an.
She calls him.
Question words are often helpful to figure out the difference between subject and object. Wer/Who would be the question for the subject, whereas whom/wen or what/was would be the question words for the object.
Wer ruft ihn an? Sie.
Who calls him? She does.
Wen ruft sie an? Ihn
Whom does she call? Him.
So you see the difference between subject and object ultimately comes down to the question who is acting on whom or what.
Very few verbs, such as sein/to be, use the nominative case on both nouns rather than the accusative case because they compare two equals, e.g:
Ich (subject) bin ein Lehrer (subject)
I am a teacher.
They need to be considered as exceptions to the rule, though.