Praise be to Allah, and peace and blessings be upon the Messenger of Allah and his family.
My brother, have great hope in Allah, and do not let the devil cause you to despair of the vast mercy of Allah which He has guaranteed for His believing slaves. What you are telling yourself about this being a sign that you will die following something other than that which Allah wants is only insinuating whispers (Waswas ) from the devil and his deviant ideas by means of which he wants to tempt the slaves of Allah and lead them away from their religion.
So he comes to a righteous slave and whispers to him that his good deeds are of no avail, or that he is doing them not for the sake of Allah but to show off to people, so that they will think he is good.
All of these are the usual ways with which the devil tries to trick the slaves of Allah, especially those who show signs of being righteous – of whom I think that you are one, although I do not praise anyone before Allah – to hinder their efforts. We seek refuge with Allah from him.
You need to increase your hope and trust in Allah Who forgives all sins, and who accepts the slave who seeks His protection and refuge, for He is the Most Merciful, the Oft-Forgiving and the Most Loving.
You should increase your good deeds , such as reading the Quran, giving charity , remembering Allah (Dhikr ), upholding the ties of kinship, etc.
The weakness which you feel also happens to others, for it is something natural. How many people were examples followed by others and had a great deal of drive and ambition, then they lost their drive and ambition for a long time, then it came back to them by the grace of Allah.
Remember the words of the Prophet (peace and blessings of Allah be upon him): “Everybody has his time of energy, and every time of energy is followed by a time of lethargy. But if a person tries to follow a moderate path, then I have hope for him, but if he becomes one who is pointed out (in the street), then do not think anything of him.” (Narrated by At-Tirmidhi, 2453; classed as sound by Al-Albani in Sahih At-Tirmidhi, 1995)
What is meant by “Everybody has his time of energy” is eagerness for a thing, energy and the desire to do good.
What is meant by “every time of energy is followed by a time of lethargy” is tiredness, weakness and lack of movement.
“But if a person tries to follow a moderate path” means that the one who has energy does his deeds in moderation and avoids going to extremes when he is feeling energetic and avoids being negligent when he is feeling lethargic.
“Then I have hope for him” means, I have hope that he will be successful, for he can continue following a middle course, and the most beloved deeds to Allah are those which are continuous.
“but if he becomes one who is pointed out (in the street)” means, if he strives hard and goes to extremes in doing good deeds so that he will become famous for his worship and asceticism, and he becomes famous and people point him out to one another,
“then do not think anything of him” means, do not think that he is one of the righteous, because he is showing off. He did not say, “do not have hope for him,” as an indication that he has already fallen, and he will not be able to make up for what he has missed out on. [Tuhfat Al-Ahwadhi]
Think about this Hadith, and relate it to your own situation and the situation of others: you will see a clear similarity. This Hadith clearly states that man goes through a stage of incomparable eagerness and great focus and ambition, then suddenly he becomes weak and loses that focus and eagerness and ambition. When he reaches this stage, he must strive even harder to do obligatory duties and avoid prohibited things. If he does that, then there is the hope that he will succeed and progress, but if he falls into prohibited things and stops doing obligatory things, he will be lost and doomed.
So you must turn to Allah a great deal, seek His forgiveness and ask Him to make you steadfast until death. I also advise you to keep away from prohibited things. May Allah forgive your sins and make things easier for you.
For more details, please see the following answers: 9356 , 10776 , 14041 , and 223615 .
And Allah knows best.