2562 Where does prayer come from? Whether prayer is expressed in words or gestures, it is the whole man who prays. But in naming the source of prayer, Scripture speaks sometimes of the soul or the spirit, but most often of the heart (more than a thousand times). According to Scripture, it is the heart that prays. If our heart is far from God, the words of prayer are in vain.
scborromeo.org/ccc/p4s1.htm
Catechism is a good place to start, the link above is the first page of several, buttons to move forward through the pages are at the bottom of the web page.
Thinking that we will always receive the result we want from prayer borders on superstition. Christ prayed to be spared the cross if possible and was refused, yet God did send an angel to strengthen Him to carry out God’s will. Prayer isn’t a magical incantation- it’s a request to God. He can and will say no, or not right now at times. Christ did tell a couple of parables about the necessity for persistence in prayer, which reinforces the point that asking more than once is necessary. But always with the goal of raising our minds and hearts to God and being open to what that means relative to our requests.
2111 Superstition is the deviation of religious feeling and of the practices this feeling imposes. It can even affect the worship we offer the true God, e.g., when one attributes an importance in some way magical to certain practices otherwise lawful or necessary. To attribute the efficacy of prayers or of sacramental signs to their mere external performance, apart from the interior dispositions that they demand, is to fall into superstition.