What we call unanswered prayer comprises one of our perennial theological dilemmas, at least for many people. “Why doesn’t God answer?” “Why doesn’t God give me what I beg him for?”
Obviously I’m not going to alleviate this dilemma in one or two paragraphs, essays, or books. But, I would like to point out that even Jesus had his request denied. On the night of his betrayal, after the Last Supper, he begged God three times to “let this cup [death] pass from me.” He even stressed “if there is any other way.”
God could not accomplish his desired salvation without sacrificing his Son. There. Was. No. Other. Way.
There are times when God cannot give you what you are asking for AND accomplish his will at the same time. In those times, trust his will over your desire. Trust his answer. Trust his grace.
And remember that although he denied Jesus’s request, he did send an angel to minister to him. Be watchful; I’ve heard that it’s sometimes easy to overlook an angel.