When our prayers are selfishly motivated, when we ask God for what we want rather than for what He wants, our motives hinders our prayers. "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).
Asking in accordance to God's will is the same as asking in submission to whatever His will maybe, whether or not we know what that will is. Jesus always prayed in the will of His father. "Yet not my will, but yours be done" (Luke 22:42).
Selfish prayers are always those that are intended to gratify our own selfish desires, and we should not expect God to respond to such prayers "when you ask, you do not receive, because you ask with wrong motives, that you may spend what you get on pleasure" (James 4:3)