There are a variety of schools of prayer that suggest different ways to pray to God. One of them is the “spontaneous” school of prayer, where only prayers that are formed on the spot are considered authentic.
The Catechism of the Catholic Churchdoes not dismiss this type of prayer entirely, but it does explain that there needs to be a certain amount of formation:
Prayer cannot be reduced to the spontaneous outpouring of interior impulse: in order to pray, one must have the will to pray. Nor is it enough to know what the Scriptures reveal about prayer: one must also learn how to pray. Through a living transmission (Sacred Tradition) within “the believing and praying Church,” the Holy Spirit teaches the children of God how to pray.
CCC 2650
What this means is that prayer needs to be done in the context of the Sacred Tradition of the Church.
We can spontaneously pray to God, but it needs to come from a heart that has learned from the Church how to pray.
Sacred Tradition of prayer
This Sacred Tradition has expanded over the centuries as the people of God have listened to the Holy Spirit:
The tradition of Christian prayer is one of the ways in which the tradition of faith takes shape and grows, especially through the contemplation and study of believers who treasure in their hearts the events and words of the economy of salvation, and through their profound grasp of the spiritual realities they experience.
CCC 2651
In this context, God is not trying to limit our access to him, but to teach us the correct way to pray.
The Church, in her wisdom, guides Christians in a school of prayer that is consistent with the Gospel and the inspirations of the Holy Spirit.
Spontaneous prayer is certainly praiseworthy, but must rise from the wellspring of the Church’s wisdom.