Temptation is the threshold to sin! A desire to do something wrong or unwise. Temptation denotes a trial in which everyone has a free choice of being faithful or unfaithful to God. The cause of temptation comes from your mind, your inward desire to an outward occasion or object.
How does one overcome temptation… Be honest with yourself, recognize potential situations. Remove yourself in body and mind from the current environment. Distract yourself, think of the long term consequences. And most importantly ‘PRAY’.  You do not have to be a slave to temptation or sin. Temptation does not have dominion over you.
Temptation has been with us since the beginning of life. Eve was deceived by satan, he did not cause her to sin, she chose to sin. Satan tried to make Eve think sin is good, pleasant, and desirable. Satan is the author of deceit. God provides us with a free will, we have the ability to make choices. A guilty conscience is a warning signal from God placed inside you that goes off when you have done something wrong.
As mentioned before prayer is key to over come temptations. Don’t be conformed to this world, be transform by renewing your mind and reading God’s word.
In James 1 the Bible says ‘ we should count it all joy when you fall into various trials and temptations , knowing that the testing of your faith produces patience and draws us closer to God.’
Some additional Bible  verses to help you with your journey.
Psalms 145. The Lord is near to them who call upon him.
Psalms 66. Oh Lord hear my voice in prayer. You are my refuge.
Psalms 71. Create in me a pure heart, renew my spirit, deliver me from the grasp of the evil one.
1 Corinthians 10:13. God is faithful, He will not allow you to be tempted beyond what you are able to handle, but with the temptation will also make way of escape, that you may be able to bear it.
Psalms 37. Delight yourself in the Lord and He will give you the desires of your heart.
Philippians 4. Rejoice in the Lord always, let your gentleness be evident to all. The Lord is near. Do not be anxious or fear circumstances, but in every situation, by prayer and petition, with thanksgiving, present your requests to God. And let the peace of God, which transcends all understanding, will guard your heart and mind in Christ Jesus.