Matt 18:19 talks about if two of you agree in prayer, then He will do it for you,
However, we both know from experience that He doesn't always do it. In fact, my experience
has been that when I agree in prayer with someone, say that they do not die from
cancer and they die anyway, then He has not honored His Word.
The verse you mention in Mathew 18:19 does not says "if two of you agree in prayer for any particular thing or healing of a sickness, then He will do it for you" as you put it, nor is this concept ever given anywhere in the Bible. You must consider the entire context of what is being said here and that can only be done by starting at verse 15;
"Moreover if your brother sins against you, go and tell him his fault between you and him alone. If he hears you, you have gained your brother. But if he will not hear, take with you one or two more, that 'by the mouth of two or three witnesses every word may be established.' And if he refuses to hear them, tell it to the church. But if he refuses even to hear the church, let him be to you like a heathen and a tax collector. "Assuredly, I say to you, whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven. "Again I say to you that if two of you agree on earth concerning anything that they ask, it will be done for them by My Father in heaven. For where two or three are gathered together in My name, I am there in the midst of them."
These verses are referring to disciplining someone who has sinned against you and that if two of you agree with things concerning them and the issues at hand, it will be given to you. This has nothing to do with praying for someone who may be dieing from cancer or any illness that just because two or more of you pray for their healing it WILL be given to you.
We need to be careful about coming to scripture with preconditioned thoughts and then trying to find a verse or verses to fit our argument. However, unfortunately this is something a lot of us do.