Extracts from a lesson given by Sayyidi Habib Umar bin Hafiz (may Allah protect him and benefit us by him) in the tafsir of Surat al-A`raf, 24th Jumada al-Akhirah 1436.
After telling us the story of Adam, Hawa and Iblis, Allah calls upon us to learn a lesson from the story. He says:
O Children of Adam, do not allow the Devil to seduce you.
We should thus be wary of the Devil and take measures to protect ourselves from him. When thoughts enter our minds, we should ask whether they are of satanic origin or angelic origin. When you remember Allah, promptings of angelic origin are strengthened, whereas promptings of satanic origin are weakened.
We find the Muslims busying themselves with perceived enemies, fighting each over the material world. Meanwhile they neglect the enemy that Allah has informed them of:
Truly the Devil is an enemy to you, so treat him as an enemy.” 
Had they been aware of the Devil, he would not have been able to stir up this hatred and enmity between them.
He is more of a threat because he sees us and we do not see him. We should thus seek refuge in the One who sees both us and the Devil constantly. As long as you are aware that your Lord sees you then the fact that the devil can see you will not harm you. Allah out of His mercy showed us how to seek His assistance and seek refuge in Him.
Imam Muhammad bin Wasi` would often make a supplication which Allah inspired him to compose. The Devil came to him and said:
“Every time I try to approach you I find a barrier in my way. What is the supplication that you make?”
“I say: O Allah, You have given an enemy power over us who sees our faults and who is aware of our weaknesses. He and his tribe see us from whence we see them not. O Allah, make him give up hope of harming us, just as You have made him give up hope of receiving Your mercy; make him despair of harming us just as You have made him despair of receiving Your pardon. Distance him from us just as You have distanced him from Paradise.”
اللَّهُمَّ إنَّكَ سَلَّطْتَ عَلَيْنَا عَدُوَّاً بَصِيرًا بِعُيُوبِنَا، مُطَّلِعًا عَلَى عَوْرَاتِنَا، يَرَانَا هُوَ وَقَبِيلُهُ مِنْ حَيثُ لا نَرَاهُم ، اللَّهُمَّ فَآيِسْهُ مِنَّا كَمَا آيَسْتَهُ مِنْ رَحْمَتِك ، وَقَنِّطْهُ مِنَّا كَمَا قَنَّطْتَهُ مِنْ عَفْوِكَ ، وَبَاعِدْ بَينَنَا وَبَينَهُ كَمَا بَاعَدْتَ بَينَهُ وَبَين جَنَّتِك.
The devil said to him:
“I promise to never approach you again if you promise not to teach anyone this prayer.”
Muhammad bin Wasi` responded:
“No, O enemy of Allah! I will teach it to as many people as I can!”
 Al-A`raf, 7:27
 Fatir, 35:6