Answered by Shaykh Faraz Rabbani
I have wasawis [misgivings] before I start a prayer, when I try to recollect which prayer exactly I am about to pray. So I was leading a prayer with my younger brother as muqtadi (Isha prayer), and as I recollected which prayer we are about to do, the actual prayer maybe was drifting away from my mind and I was focusing on the word Isha’ again and again in mind and softly-spoken words. I eventually started, but I had just thought of that word, and probably lost/forgot which prayer I was really doing please, can you help me?
Intention is very easy:
a) the legal minimum is to have the firm resolve to be performing the given action. It is known by the fact that if someone were to ask you what you are doing, you could say, “The Isha prayer,” for example, without hesitation. In your case above, this intention was evidently present;
b) the optimal intention should include an explicit turning of one’s heart towards drawing closer to Allah.
Imam Abu Hanifa (Allah have mercy on him) said, “Fiqh is to know one’s self: what is for it and against it.”