As an obedient Son, Jesus set the example. In John 12:27-28, Jesus was struggling with thoughts of what He would suffer on the cross. He said,
Now is My soul troubled. And what shall I say? “Father, save Me from this hour”? But for this purpose I have come to this hour. Father, glorify Your name.” Then a voice came from heaven: “I have glorified it, and I will glorify it again” (John 12:27-28).
We too ask, “Shall I seek what would selfishly benefit me?” If we follow in Jesus’ steps, the answer must be, “No! I will seek the things that let God glorify Himself through my life (or my death)!” Indeed, we can be sure that ill-motivated prayers will fail, as James explains.
You ask and do not receive, because you ask wrongly, to spend it on your passions (James 4:3).
In the Garden of Gethsemane, Jesus prayed, “Abba, Father, all things are possible for You. Remove this cup from Me. Yet not what I will, but what You will” (Mark 14:36). In His second prayer He said, “My Father, if this cannot pass unless I drink it, Your will be done” (Matthew 26:42). In each of these prayers we see the attitude of total surrender to God’s will.