1 John 3:21-24 (NIV) Dear friends, if our hearts do not condemn us, we have confidence before God and receive from him anything we ask, because we keep his commands and do what pleases him. And this is his command: to believe in the name of his Son, Jesus Christ, and to love one another as he commanded us. The one who keeps God’s commands lives in him, and he in them. And this is how we know that he lives in us: We know it by the Spirit he gave us.
God answers prayers for people who keep his commandments. His commandments are summed up in these two: 1) believe in the name of Jesus, and 2) love each other.
He means that prayer has a specific design, and if you misuse it, it malfunctions. What is the design of prayer? Prayer is designed by God to be the effect of faith and the cause of love.
Therefore if we try to pray when we really do not believe in the name of his Son, prayer malfunctions. And if we try to pray when our aim is not to love, prayer malfunctions.
This is why “We receive from him whatever we ask, because we keep his commandments.” Not because keeping his commandments earns answers to prayer, but because prayer is designed to give power in the path of obedience. Prayer is God’s way of making himself available for us when we are pouring ourselves out in love for others. Prayer is the power to love. Therefore if we do not aim to love, we pray in vain. Prayer is not designed to compound hoarded pleasures.
Prayer is a way of calling God alongside us in doing what Jesus came to do. “By this we know love, that he laid down his life for us; and we ought to lay down our lives for the brothers” (1 John 3:16). This is why believing Jesus and loving others are linked together as the way to answered prayers. Believing Jesus means that we admire the way he lived and want to be like him. You can’t believe in someone and think the way he lived was foolish. So believing in Jesus will necessarily lead us to want to love others the way he did. Believing in the name of Jesus and loving one another are almost one thing.
And since God was entirely behind Jesus with all his power and gave him all the help he needed, he will be behind us too when we believe in Jesus and love like Jesus. So the reason God answers the prayers of those who believe in the name of Jesus and love others like Jesus is that God loves to magnify Jesus. (Desiring God, Ptr John Piper)