In most cases temptation comes from the things that surround us e.g the programs we watch on television, the friends we have,the places we to.
You cannot watch movies with sexual scene and your mind remains the same,you cannot keep friends who like drinking,gossiping or prostitutes and you don't do what they do.
To keep away from sin your mind should be filled with the positive things and the spirit of the living God.
We should learn to control the things of our mind,ie our thoughts. Because the things that take up our mind they become actions.
Their is a saying that goes like"show me your friends and i will tell you who you are".we need to avoid toxic friends,place that do not glorify God and movies that are bad for our souls.
In Genesis chapter 3, the Bible says, “The serpent was the shrewdest of all the creatures the Lord God had made…he asked the woman, ‘Did God really say…?’(Genesis 3:1). First, Satan will blind you to all the good things God has in store for you. Then he’ll take substances like alcohol or drugs, or somebody else’s husband or wife, or Internet porn, and tell you it won’t hurt you. He’s a liar. Don’t believe him.
The Lord draws people close to His side, to walk with them, to work with them, to teach them how He overcame every temptation in humanity, and how, therefore, they may overcome through the provision the Lord has made. With every temptation there is a way of escape, by walking humbly with God. Without faith, ever increasing faith, it is impossible to please God.
The Bible says “Temptation comes from our own desires.These desires give birth to sinful actions. And when sin is allowed to grow, it gives birth to death. So don’t be misled(James 1:14-16). Failure to identify your weakness strengthens it; and will eventually take over your life and destroy God’s plan for you. So how do you overcome your weakness? You do this by meditating on the Word of God day and night,and being obedient to what it says(Joshua 1:8).
He who is in us is stronger than the one who is in the world.