The Prophet Muhammad narrated a story to his Companions so that they could drive inspiration from it.
The story goes like this:
A man felt very thirsty while he was on the way; there he came across a well. He went down the well, quenched his thirst and came out. Meanwhile he saw a dog panting and licking mud because of excessive thirst. He said to himself, ‘This dog is suffering from thirst as I did.’ So, he went down the well again, filled his shoe with water, held it with his mouth and watered the dog. God appreciated him for that deed and forgave him.
The Companions said, “O God’s Messenger! Is there a reward for us in serving the animals?”
He replied: “There is a reward for serving any living being.” (Source: Bukhari)