The following passage is from John Calvin's Institutes of the Christian Religion. I've posted the same passage from two different translations. First from the Beveridge translation. The second is from the Battles translation.
Beveridge translation:
This concurrence David expresses in a few words: “But as for me, I will come into thy house in the multitude of thy mercy, and in thy fear will I worship toward thy holy temple,” (Ps. 5:7). Under the goodness of God he comprehends faith, at the same time not excluding fear; for not only does his majesty compel our reverence, but our own unworthiness also divests us of all pride and confidence, and keeps us in fear. The confidence of which I speak is not one which frees the mind from all anxiety, and soothes it with sweet and perfect rest; such rest is peculiar to those who, while all their affairs are flowing to a wish are annoyed by no care, stung with no regret, agitated by no fear. But the best stimulus which the saints have to prayer is when, in consequence of their own necessities, they feel the greatest disquietude, and are all but driven to despair, until faith seasonably comes to their aid; because in such straits the goodness of God so shines upon them, that while they groan, burdened by the weight of present calamities, and tormented with the fear of greater, they yet trust to this goodness, and in this way both lighten the difficulty of endurance, and take comfort in the hope of final deliverance. It is necessary therefore, that the prayer of the believer should be the result of both feelings, and exhibit the influence of both; namely, that while he groans under present and anxiously dreads new evils, he should, at the same times have recourse to God, not at all doubting that God is ready to stretch out a helping hand to him. For it is not easy to say how much God is irritated by our distrust, when we ask what we expect not of his goodness. Hence, nothing is more accordant to the nature of prayer than to lay it down as a fixed rule, that it is not to come forth at random, but is to follow in the footsteps of faith. To this principle Christ directs all of us in these words, “Therefore, I say unto you, What things soever ye desire, when ye pray, believe that ye receive them, and ye shall have them,” (Mark 11:24). The same thing he declares in another passage, “All things, whatsoever ye shall ask in prayer, believing, ye shall receive,” (Mt. 21:22). In accordance with this are the words of James, “If any of you lack wisdom, let him ask of God, that giveth to all men liberally, and upbraideth not, and it shall be given him. But let him ask in faith, nothing wavering,” (James 1:5). He most aptly expresses the power of faith by opposing it to wavering. No less worthy of notice is his additional statement, that those who approach God with a doubting, hesitating mind, without feeling assured whether they are to be heard or not, gain nothing by their prayers. Such persons he compares to a wave of the sea, driven with the wind and tossed. Hence, in another passage he terms genuine prayer “the prayer of faith,” (James 5:15). Again, since God so often declares that he will give to every man according to his faith he intimates that we cannot obtain any thing without faith. In short, it is faith which obtains every thing that is granted to prayer. This is the meaning of Paul in the well known passage to which dull men give too little heed, “How then shall they call upon him in whom they have not believed? and how shall they believe in him of whom they have not heard?” “So then faith cometh by hearing, and hearing by the word of God,” (Rom. 10:14, 17). Gradually deducing the origin of prayer from faith, he distinctly maintains that God cannot be invoked sincerely except by those to whom, by the preaching of the Gospel, his mercy and willingness have been made known, nay, familiarly explained.- John Calvin, Institutes of the Christian Religion, book 3, section 11
https://ccel.org/ccel/calvin/institutes/institutes.v.xxi.html
Battles translation:
And David briefly expresses this agreement when he says: “I through the abundance of thy goodness will enter thy house, I will worship toward the temple of thy holiness with fear”. Under God’s goodness he includes faith, meantime not excluding fear. For not only does his majesty constrain us to reverence but through our own unworthiness, forgetting all pride and self-confidence, we are held in fear. But “assurance” I do not understand to mean that which soothes our mind with sweet and perfect repose, releasing it from every anxiety. For to repose so peacefully is the part of those who, when all affairs are flowing to their liking, are touched by no care, burn with no desire, toss with no fear. But for the saints the occasion that best stimulates them to call upon God is when, distressed by their own need, they are troubled by the greatest unrest, and are almost driven out of their senses, until faith opportunely comes to their relief. For among such tribulations God’s goodness so shines upon them that even when they groan with weariness under the weight of present ills, and also are troubled and tormented by the fear of greater ones, yet, relying upon his goodness, they are relieved of the difficulty of bearing them, and are solaced and hope for escape and deliverance. It is fitting therefore that the godly man’s prayer arise from these two emotions, that it also contain and represent both. That is, that he groan under present ills and anxiously fear those to come, yet at the same time take refuge in God, not at all doubting he is ready to extend his helping hand. It is amazing how much our lack of trust provokes God if we request of him a boon that we do not expect.
Therefore nothing is more in harmony with the nature of prayers than that this rule be laid down and established for them: that they not break forth by chance but follow faith as guide. Christ calls this principle to the attention of all of us with this saying: “I say unto you, whatever you seek... , believe that you will receive it, and it will come to you” He confirms the same statement in another place: “Whatever you ask in prayer, believing” etc.. James is in accord with this: “If any of you lack wisdom, let him ask God, who gives to all men simply and without reproaching... Let him ask in faith, with no wavering”. There, opposing faith to wavering, he most appropriately expresses the force of faith.
Nonetheless, what he adds must also be noted: that they who in doubt and perplexity call upon God, uncertain in their minds whether they will be heard or not, will gain nothing. He even compares these persons to waves that are driven and tossed hither and thither by the wind. Hence, in another passage, James calls what is right and proper “the prayer of faith”. Then, since God so often affirms that he will give to each one according to his faith, he implies that we can obtain nothing apart from faith. To sum up, it is faith that obtains whatever is granted to prayer. Such is the meaning of Paul’s famous statement, which the unwise too little regard: “How will anyone call upon him in whom he has not believed? And who will believe unless he has heard?”. “Faith comes by hearing, and hearing from the Word of God.” For, deducing step by step the beginning of prayer from faith, he plainly asserts that God cannot be sincerely called upon by others than those to whom, through the preaching of the gospel, his kindness and gentle dealing have become known—indeed, have been intimately revealed.