There are only six cases in russian:
1. Именительный. (derivative from имя\name)
2. Родительный. (derivative from родить\to born. Just ask - What did it born?)
3. Дательный (derivative frome дать\to give. Just ask - Give to whom\to what?)
4. Винительный. (derivative from винить\to judge (smb.) Judge who? Judge what?)
5. Творительный.(derivative from творить\to create. Create by who \by what? )
6. Предложный. (Ask - About what? About who?)
Some samples are:
1. стол, ручка, кровать, дверь (a table, a pen, a bed, a door)
2. стол, ручку, кровать, дверь
3. столу, ручке, кровати, двери
4. стол, ручку, кровать, дверь
5. столом, ручкой, кроватью, дверью.
6. о столе, о ручке, о кровати, о двери.
You need more practice to use these endings. The most russians dont think about rules, they just use the endings they have taught from the birth in common speech.