In the Apostle James's open letter to the saints in the primitive Church of his day, he reminded them (and us) why our prayers sometimes go unanswered.
Ye ask, and receive not, because ye ask amiss, that ye may consume it upon your lusts.
--James 4:3
In other places we are told to let the Holy Ghost guide our prayers. Without the Spirit's guidance, we may very well pray for things not in harmony with God's will.
I am grateful the Lord is kind enough to ignore my misguided and self-centered prayers. I am reminded of Garth Brooks's lyric, "thank God for unanswered prayers."