.From Sinning Against Yourself (#661) by Rabbi Avigdor Miller
The gemara explains how important it is to pray with kavana: “eilu devarim she’adam ochel peiroseihem ba’olam hazeh” (Peah 1:1), for the following things a person is rewarded even in This World. Not the principle; “hakeren kayemes la’olam habah — the main reward is in the World to Come,” but the peiros, like interest on the principle, is given even in This World for certain things, such as doing kindly things to people, doing acts of kindnesses. Also among them it says, “v’iyun tefila”: “looking into” the davening. This means praying with thought.
The gemara asks a question. If a man is rewarded with peiros ba’olom hazeh (the reward in This World) only for gemilas chasadim, for acts of kindliness, so how does iyun tefila turn into kindliness? Where is the kindliness in praying with kavana?
True tefillah (prayer) is only when it is backed by your own actions to show that you really want it
The gemara answers, “hani nami behani mishoshaychi” (Shabbas 127b): praying with kavana is a very great kindliness to yourself. We have to understand that... When you are praying, you are doing a gemilas chesed to yourself (see Rashi there).
You say, “refaeinu Hashem v’neirofeh — Heal us and we will be healed” (Shemoneh Esreh), you pray for yourself. The gemara is telling us that it is very important to pray because it helps. It’ll help you remain healthy.
Of course, if you pray for good health, but you yourself are ruining your health, so your prayer is not sincere, it is not a true tefillah. A true tefillah is only when it is backed by your own actions to show that you really want it. If a person eats nasherai (junk food) all the time, things that are only good for the pallet but not good for his health, so Hashem says, “look, you are not praying for health, because you see your actions contradict your words.”
“Karov Hashem l’chal korav — Hashem is close to all those who call out to Him, “l’chal asher yikra’uhu be’emes — to all those who call out to Him in truth” (Ashrei). You have to call out in truth. But, when a person tries to be healthy and he asks Hashem for good health, it is going to help. It is a very important principle.