The Sefer Ha’Ikarim (Maamid 4, Perek 24) writes: “Many times, people daven properly, in the proper time and in the proper way, but the tefillah is not accepted. This could be the result of a punishment or because the person is not worthy of having his prayers answered until he davens some more or because Hashem knows that the thing he is asking for is not good for him. Because He cares for him, He does not accept his prayer. For example, someone who is davening for children may not be answered because Hashem knows that the children will be bad, or someone who davens for money may not be answered because Hashem knows that money will cause his death. Therefore, it would be better to daven by saying, ‘Ribono Shel Olam, do Your will Above and give nachas ruach to those who fear You below, and help me in the way that is good in Your eyes.”
