This past fall I lost my grandmother. I prayed and prayed for her, and I thought God would heal her, but He had different plans.
So many people become upset when they pray for God to do something and the outcome isn't what they wanted. They always say that God never answered their prayer. God did answer their prayer, but maybe He didn't answer it the way they wanted the prayer answered.
When I lost my grandmother, I could have gotten mad at God for taking her and not healing her. I knew that God had different plans though. He still answered my prayer. He heard my prayer, He just had something different in mind.
God can see into the future and knows what will happen. Because we are human we can only see what is in front of us at the moment. We cannot see what is going to happen months down the road. So when things don't go the way we wanted them to go, and God decides to take a different route than the ones that we planned, we need to trust Him. God knows best, always.