Learning how to pray can often be difficult, but the good news is that Jesus gave us an example with his life.
The Catechism of the Catholic Church mentions how Jesus would frequently begin his prayers with thanksgiving:
The evangelists have preserved two more explicit prayers offered by Christ during his public ministry. Each begins with thanksgiving. In the first, Jesus confesses the Father, acknowledges, and blesses him because he has hidden the mysteries of the Kingdom from those who think themselves learned and has revealed them to infants, the poor of the Beatitudes. His exclamation, “Yes, Father!” expresses the depth of his heart, his adherence to the Father’s “good pleasure,” echoing his mother’s Fiat at the time of his conception and prefiguring what he will say to the Father in his agony.
CCC 2603
Jesus prays again before the raising of Lazarus:
The second prayer, before the raising of Lazarus, is recorded by St. John. Thanksgiving precedes the event: “Father, I thank you for having heard me,” which implies that the Father always hears his petitions. Jesus immediately adds: “I know that you always hear me,” which implies that Jesus, on his part, constantly made such petitions. Jesus’ prayer, characterized by thanksgiving, reveals to us how to ask: before the gift is given, Jesus commits himself to the One who in giving gives himself. The Giver is more precious than the gift; he is the “treasure”; in him abides his Son’s heart; the gift is given “as well.
CCC 2604
Jesus teaches us a simple lesson: begin our prayers thanking God.
We don’t necessarily have to do it every time, but thanksgiving needs to be a regular part of our prayer life, especially if we are constantly asking God for things.
Before we can ask God for more answers, we need to thank him for what we have already received.