Hi MarieVeronica
So you said we pray because it is Christian Charity. That does not really answer the question.
Well, you asked, specifically… why do we pray for someone who is sick or terminally ill. And my reply to the specific question was… “out of Christian Charity”. In other words, in response to Christ’s teachings. “Do unto others, as you would have them do unto you”. I can only speak for myself… but I know that if I were dying of cancer… with only a month to live. I would be greatly comforted by the prayers of my family and friends. (Perhaps my view on this is rather simple, child-like. But, child-like faith is good).
If God already does know the outcome, no matter how we pray, it will still come out the same in the end.
In my previous response… I quoted the Catechism of the Catholic Church… which says that Almighty God has “factored in” the decisions of our free will, which is His gift to us. He has somehow incorporated our various free will decisions… into His “Plan”. How has He done this? Well, being only creatures… chances are, we will never know. Just as we will probably never know, how God created everything… out of nothing.
Can a man freely choose good or evil… at any time while he is alive? Yes. Does God know which path each man will ultimately choose? Yes. Does that mean that our prayers have “no effect”? Absolutely not. Human prayer is of infinite value and worth. Otherwise, Our Lord would not have taught us to pray. He wants us to pray. The best example of this is the Mass. It is the highest form of prayer… which Our Lord Himself, instituted. Extremely valuable, when offered for the souls of our departed loved ones. Suffering can also be offered as a prayer, in this way.
If I pray for my mom’s health to get better and she passes away, the outcome would have still been the same.
Let’s say that this happens. You’ve prayed for your mom… but she passes away. Dear soul, we would never know… in this situation, how many graces we may have obtained for a loved one who died. Your prayers… could shorten a loved ones time in purgatory… or even get them into Heaven.
In regards to the effectiveness of prayer, I can offer a personal experience to you. My mother and I have been praying for years for my sister… who fell away from the Church. She hadn’t been to Mass, since 1979. She returned to the practice of the faith, this past Easter. To us, this is a miracle and clear proof that God does hear our prayers.

Especially, since I myself… had fallen away from the faith for about 10 years. The Lord in His Mercy… still heard my prayers for my sister.
the CCC (600) you mentioned, still does not say anything about why pray for the right decision, why pray for a healthy child, why pray we make the right choices.
“How is our prayer efficacious?”
CCC (2738) “The revelation of prayer in the economy of salvation teaches us that faith rests on God’s action in history. Our filial trust is enkindled by His supreme act: the Passion and Resurrection of His Son. Christian prayer is cooperation with His Providence, His plan of love for men.”
The best prayer we can ever offer is to say… “THY Will be done, Father”. This is in imitation of Jesus… as He prayed in the Garden of Gethsemane. To pray that the Father’s Will be done… is always to pray for the right decision. Because the Father’s Will… IS the “right decision”.
God bless.