If you abide in me, and my words abide in you, ask whatever you wish, and it will be done for you. - John 15:7 (ESV)According to just that verse, there are three requirements to getting your prayers answered:
1. Abide in Jesus
2. Have His Word in you
3. Ask in prayer
Of course, the context does a lot to define what it means to "abide in Jesus," so you can read that on your own, but in a nutsheel that's kind of it. At least, I always thought that was it, until last night when I read the passage to my son. Check out verse 16:
You did not choose me, but I chose you and appointed you that you should go and bear fruit and that your fruit should abide, so that whatever you ask the Father in my name, he may give it to you. - John 15:16 (ESV)That presents another requirement: you must be BEARING FRUIT. If you really need proof that bearing fruit is part of the scenario, read verse 7 in context:
I am the true vine, and my Father is the vinedresser. Every branch of mine that does not bear fruit he takes away, and every branch that does bear fruit he prunes, that it may bear more fruit. Already you are clean because of the word that I have spoken to you. Abide in me, and I in you. As the branch cannot bear fruit by itself, unless it abides in the vine, neither can you, unless you abide in me. I am the vine; you are the branches. Whoever abides in me and I in him, he it is that bears much fruit, for apart from me you can do nothing. If anyone does not abide in me he is thrown away like a branch and withers; and the branches are gathered, thrown into the fire, and burned. If you abide in me, and my words abide in you, ask whatever you wish, and it will be done for you. By this my Father is glorified, that you bear much fruit and so prove to be my disciples. - John 15:1-8 (ESV)You can't expect to follow some magic formula and somehow make God give you something, of course; sometimes God does things for reasons we don't understand. But it does make sense to live your life in such a way that you are not the cause of something you pray for not happening. If you re-read verse 16 above, it almost sounds like God is really wanting to fulfill your request, if you would just BEAR SOME FRUIT so He could do it! "...so that... he MAY give it to you." Of course, it could be argued that "bearing fruit" is part of "abiding in Me" (see verses 4-6), so really it's all present in verse 7, but it's illuminating how well it is summed up a few verses later.