I recently saw a post on social media that said the following:
If my prayers go unanswered, I ask myself 3 questions:
1) Whom have I granted access to my life that doesn't belong there? (Wrong people can be doors of entry to demonic forces.)
2) Am I trusting wrong voices? (Faith cometh by hearing)
3) Did I allow anger to "mature" into bitterness?
I can see a biblical basis for number 3 in a way. Jesus taught that if we are bringing our gift to the altar, and remember that we have a conflict with a brother or sister, then we should go and be reconciled to our brother/sister first, then bring our gift to God. I think we can apply the same principle to our petitions to God.
I'm not so sure about the first two, at least in a direct way..
Biblically, I think a couple of better questions would be:
1) Is what I am asking for in line with the will and character of God as revealed in Jesus Christ?
This is the confidence we have in approaching God: that if we ask anything according to his will, he hears us. (1 John 5:14)
2) Am I asking out of selfish motives?
When you ask, you do not receive, because you ask with wrong motives, that you may spend what you get on your pleasures. (James 4:3)
As to points 1 and 2 in the post I saw, I will grant that letting the wrong people into our lives, and listening to the wrong voices, could lead us to desire, and ask for, things that are not in alignment with God's will and character, or that are motivated out of ego or selfishness. But I would argue that we should ask the primary questions based on the Scripture references I have shared, which get to the matters of our own heart condition, rather than focusing on the condition of the people around us.