Angel Jibrail (as) told Prophet Muhammad (saw) the following incident about a man in the past who worshiped Allah (swt) continuously for 500 years. He was granted a shelter on top of a mountain that was surrounded by salty water. However, Allah caused a stream of sweet water to flow through the mountain for that individual. The man would drink from this water and use it to make ablution. Allah (swt) also raised a pomegranate tree from which the man would eat one fruit every day.
One day, this person supplicated to Allah that, "Oh Allah, bring my death while I am in the state of prostration." Allah accepted this dua of his. Whenever Jibrail (as) came down to the Earth, he found this man prostrating to Allah. Jibrail (as) said that on the day of Judgement, Allah will tell the angels to take this individual to Paradise through His mercy. However, this man will insist that he should enter paradise through the good deeds that he had performed.
Then, Allah will tell the angels to compare his good deeds with the blessings that were given to him in the world. It will be seen that 500 years of his worship does not even equal to the gift of eye sight that was given to him by Allah. The angels will be asked to take him towards the hell fire. Then the man will plead, "Oh Allah! Enter me into Paradise only through Your mercy." At that point, the following discussion will take place between Allah and that man.
Allah (swt): Oh my servant, who created you?
The worshiper: Oh Allah, You have created me.
Allah (swt): Were you created because of the good deeds you have done or because of My mercy?
The worshiper: Because of Your mercy.
Allah (swt): Who granted you the ability to worship for 500 years?
The worshiper: Oh the Almighty! You have granted me that ability.
Allah (swt): Who placed you on the mountain surrounded by the ocean? Who caused a stream of sweet water to flow in between the salty water? Who caused a pomegranate tree to grow for you? Who granted you death while in the state of prostration?
The worshiper: Oh the Sustainer of the Worlds! You have done all of these.
Then Allah (swt) will say, "All these have happened due to My mercy and you too will enter Paradise only through My Mercy."
We can never thank Allah (swt) for the blessings that He has given us. Let us use these blessings to recognize Allah before our death.
Source: Obtained from the book "Tambihul Ghafileen" by Shaikh Abul Laith Samarkandi.