God does not always answer your prayers the way you wanted. I have found that sometimes it’s because what you are praying for interferes with another person’s agency. God will not force people to choose the right. He gives us plenty of opportunities — but to force it would be Lucifer’s plan. I have often struggled with the faith issue, thinking, if I pray with enough faith and if it is God’s will and mine, and it is a good desire, then my prayers will be answered as I had hoped. But even when it is God’s desire — he does not usurp man’s agency.
I read, this, from a prophet —
“I prayed… but without faith..”
Mormon was a Nephite prophet, a military general from the age of 15, and record keeper, who lived about 311 to 385 A.D. He compiled the Book of Mormon (thus the name of the book) and turned it over to his son, Moroni — the guy who delivered it to Joseph Smith in the 1800s. Mormon searched through the records of past people and civilizations that lived in the Americas, abridged them, and then added his own first-hand account before handing the sacred journal over to his son.
Mormon wrote about his people — the Nephites — when they had turned against the Lord, fighting in wars and loving wickedness more than happiness. They refused to acknowledge their Maker. They no longer believed in God.
I have often wondered why Mormon, the great General, continued to stand by his people when they chose this course. Why did he continue to lead them into battle? In fact, he says he “loved them, according to the love of God,” And he prayed for them. But he finally stopped leading them. They were seeking vengeance through war, and though he had prayed for them, he confides, it was without faith.

…and my soul had been poured out in prayer unto my God all the day long for them; nevertheless, it was without faith, because of the hardness of their hearts. (Mormon 3:12)

Mormon continued to pray. He continued to pray even when he had no faith in his people. But he did get an answer  — the Lord told him that He would handle it. At that point, Mormon refused to lead his people further into battle; instead, he became a witness:

Vengeance is mine, and I will repay; and because this people repented not after I had delivered them, behold, they shall be cut off from the face of the earth.

And it came to pass that I [Mormon] utterly refused to go up against mine enemies; and I did even as the Lord had commanded me; and I did stand as an idle witness to manifest unto the world the things which I saw and heard, according to the manifestations of the Spirit which had testified of things to come.
Mormon prayed for his people, but his people had their agency, which God will not overrule. No man will be forced to heaven; you know that saying.