The Bible says “the prayer of faith shall save the sick”:
James 5:14-15 King James Version (KJV)
14 Is any sick among you? let him call for the elders of the church; and let them pray over him, anointing him with oil in the name of the Lord:
15 And the prayer of faith shall save the sick, and the Lord shall raise him up; and if he have committed sins, they shall be forgiven him.
Jesus’ reason was “unbelief” towards his disciples, and said “If ye have faith as a grain of a mustard seed”, “nothing would be impossible unto you”:
Matthew 17:20 King James Version (KJV)
20 And Jesus said unto them, Because of your unbelief: for verily I say unto you, If ye have faith as a grain of mustard seed, ye shall say unto this mountain, Remove hence to yonder place; and it shall remove; and nothing shall be impossible unto you.
Even Jesus could not perform many miracles in his hometown for their “unbelief” but He still healed “a few sick folk”:
Mark 6:5-6 King James Version (KJV)
5 And he could there do no mighty work, save that he laid his hands upon a few sick folk, and healed them.
6 And he marvelled because of their unbelief. And he went round about the villages, teaching.
The Bible says “God heareth not sinners” but those that “doeth his will, him he heareth”:
John 9:31 King James Version (KJV)
31 Now we know that God heareth not sinners: but if any man be a worshipper of God, and doeth his will, him he heareth.
The person trying to heal someone but “turneth away his ear from hearing the law, even his prayer shall be abomination”:
Proverbs 28:9 King James Version (KJV)
9 He that turneth away his ear from hearing the law, even his prayer shall be abomination.