Why could we not cast it out?
As a disciples of Jesus Christ, the Apostles did so many miracles by the authority given by Lord - And he called the twelve and began to send them out two by two, and gave them authority over the unclean spirits. He charged them to take nothing for their journey except a staff, no bread, no bag, no money in their belts, but to wear sandals and not put on two tunics. And he said to them, Whenever you enter a house, stay there until you depart from there. And if any place will not receive you and they will not listen to you, when you leave, shake off the dust that is on your feet as a testimony against them. So they went out and proclaimed that people should repent. And they cast out many demons and anointed with oil many who were sick and healed them - Mark 6:7-13
Now they are failing in casting the Demon, and complaints rose against the fully equipped disciples - And someone from the crowd answered him, Teacher, I brought my son to you, for he has a spirit that makes him mute. And whenever it seizes him, it throws him down, and he foams and grinds his teeth and becomes rigid. So I asked your disciples to cast it out, and they were not able. And he answered them, O faithless generation, how long am I to be with you? How long am I to bear with you? Bring him to me - Mark 9:17-19
When Jesus Christ cast down the demon, the disciples asked the reason for their failure - And they brought the boy to him. And when the spirit saw him, immediately it convulsed the boy, and he fell on the ground and rolled about, foaming at the mouth. And Jesus asked his father, How long has this been happening to him? And he said, From childhood. And it has often cast him into fire and into water, to destroy him. But if you can do anything, have compassion on us and help us. And Jesus said to him, If you can! All things are possible for one who believes. Immediately the father of the child cried out and said, I believe; help my unbelief! And when Jesus saw that a crowd came running together, he rebuked the unclean spirit, saying to it, You mute and deaf spirit, I command you, come out of him and never enter him again. And after crying out and convulsing him terribly, it came out, and the boy was like a corpse, so that most of them said, He is dead. But Jesus took him by the hand and lifted him up, and he arose. And when he had entered the house, his disciples asked him privately, Why could we not cast it out?. So He said to them, This kind can come out by nothing but prayer and fasting - Mark 9:20-29
What caused disciples failure? Did fasting and prayer helped them finding the reason?
Because Lord already gave power over all types of demons - And he called the twelve together and gave them power and authority over all demons and to cure diseases - Luke 9:1
and Christ also told clearly that the Disciples need not to fast until the Son of God taken into heaven - And He said to them, “Can you make the friends of the bridegroom fast while the bridegroom is with them? But the days will come when the bridegroom will be taken away from them; then they will fast in those days.” - Luke 5:34-35
From this single failure, the disciples learnt many things to be a follower of Jesus Christ, will see one by one.
Lesson 1: Do not think others are less important for Lord Jesus Christ.
Lesson 2: Do not dominate others
Lesson 3: Do not stop what others are doing for Lord Jesus Christ.