In fighting temptation, regardless of its type, prayer is a weapon that we cannot do without it. The purpose of temptation is to ensnare us and to draw us away from God. Prayer, fellowship with God, is the exact opposite: it keeps the channels of communication with our Father open. Oh what comfort and love comes from the Father and what support to those who resist the enemy find when they go to Him in prayer.
The night the Lord Jesus was captured, in the garden of Gethsemane, he told to his disciples:
“Watch and pray, lest you enter into temptation. The spirit indeed is willing, but the flesh is weak.”
“And when he was at the place, he said to them, Pray that you may not enter into temptation.”
And Luke 22:46
“And he said to them, “Why do you sleep? Rise and pray, lest you enter into temptation.”
Temptation is described here as something the disciples could enter into and the proper response would be to pray. Thus prayer and temptation are put against each other:
“Pray, lest you enter into temptation”, the Lord said. Obviously if they did not pray they would indeed enter into temptation. Prayer, fellowship with God, keeping the channels of communication open and receiving from Him through prayer the needed encouragement and support, is a shield of protection against temptation.
This does not necessarily mean that the temptation will not come. But what it for sure means, is that when/if it comes it will find us steadfast in the faith and not ready to fall into its trap.