We are told that that we should serve G-d without thinking of the reward. This makes sense to me, since it seems more sincere. But is this really the case in Jewish teachings, and if so, how can one do this practically? And what about other thoughts that come to mind when we learn or do mitzvot?
Yes, this is the case in Jewish teachings.
For example, Pirkei Avot, a collection of ethical teachings from the Talmudic Sages, states, “Don’t be like servants who serve their master to receive reward, but rather be like servants who serve their master not to receive reward, and let Fear of Heaven be on you” (1:3).
You see from here that we are to serve G-d without thinking of the reward. Rather, our intentions should be solely to serve G-d.
In fact, one version of the teaching goes so far as to say, “…rather be like servants who serve their master on condition that they receive no reward”.
According to this, we must banish all thoughts of reward, and in fact desire to serve G-d with the understanding that there be no reward at all.
Admittedly, practically this is very hard to do. What’s more, as you note, we often have other intentions and thoughts, like how we look, what others think of us, whether we’ll get some tangible benefit from it, or even when the prayer or mitzvah will be over.
As far as working on not serving for reward, personally, it helps me to consider that since I fall so short of what I could be doing, I am culpable for “mis-doing” what I do. In this way, I consider it as if I’m doing it despite the fact that I’ll be held accountable for doing it wrong, and therefore not for the reward.
As far as dealing with other distracting thoughts, I personally find it helpful to remind myself that absolutely none of the factors or considerations that are distracting me would exist for me if I did not exist. I owe my entire existence, including everything in my personal reality, to G-d. Therefore, it is only to Him, and with thoughts only of Him, that I should serve.
Once Rabbi Chaim of Krosno witnessed how a certain man appeared in the central square claiming he would tightrope across the dangerous river running outside of the town, but only if everyone paid a certain amount for the spectacle. After the onlookers gathered and the money was collected, the man proceeded to cross with great caution to the amazement of the crowd.
When the rabbi’s disciples asked him what he thought of the feat, he replied, “Even though he did it entirely for the reward, I guarantee you that while suspended above the treacherous waters he didn’t think about the money at all, but only about what he was doing, because the moment he would have broken his concentration on crossing he would have fallen.”
We must learn from this tightrope walker that even though we are promised reward upon crossing over, we must not think about that at all while we’re crossing, but rather concentrate only on making sure we take exactly the right steps to ensure that we get to the other side – any distracting thoughts or intentions on the way might topple us into the tumultuous depths.