There are several instances in the Bible where someone prayed for something, and God's answer was different than what they specifically asked for. Here are a few prominent examples:
* Jesus in the Garden of Gethsemane (Matthew 26:36-44, Mark 14:32-39, Luke 22:39-46): Jesus prayed, "My Father, if it is possible, let this cup pass from me; yet not as I will, but as you will." He asked to avoid the suffering of the crucifixion, but God's will was for him to endure it. The answer wasn't "yes" to his request, but God provided strength, comfort, and ultimately, resurrection and glory through his sacrifice.
* Paul's Thorn in the Flesh (2 Corinthians 12:7-10): Paul pleaded with the Lord three times to remove a "thorn in the flesh" that was tormenting him. God's answer was, "My grace is sufficient for you, for my power is made perfect in weakness." God didn't remove the problem but instead offered the grace to endure it, and through that weakness, God's power was manifested.
* Moses Asking to Enter the Promised Land (Deuteronomy 3:23-29): Moses begged God to let him cross over the Jordan and see the good land. God refused his request, saying, "Enough, do not speak to Me anymore about this matter." While seemingly harsh, this was related to Moses' earlier disobedience at Meribah. Instead, God allowed him to see the land from a distance and appointed Joshua to lead the people.
* King David Praying for His Sick Child (2 Samuel 12:15-23): When the child born to David and Bathsheba became ill, David pleaded with God, fasting and lying on the ground. However, the child died. David accepted God's will, understanding that God's ways are higher than his own.
These examples demonstrate that God's answer to prayer isn't always "yes," but it's always according to His perfect wisdom and plan. Sometimes, the answer is "no," "not yet," or a different path altogether. These instances emphasize the importance of trusting God's sovereignty even when His answer doesn't align with our desires.