All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
‘Umar said that the Prophet said: "It is incumbent upon you to be with the Muslim group and you must avoid disunity. The Satan is with a single person and it is far from two persons." [At-Tirmithi]
The narration proves that Satan is stronger on one person rather than two. In order to protect oneself from Satan and his evil, one should keep company of pious people, adhere to the rulings of Quran and Sunnah, be obedient to Allaah and His Prophet keep on recitation of Quran and remembrance of Allaah, do good and avoid prohibitions, and should seek Islamic knowledge.
Therefore, you have to learn beneficial knowledge, recite Quran, stay engaged in the company of Muslim scholars and religious people, keep on the remembrance of Allaah and the supplication said in the morning, evening and before going to sleep, etc. If you do what is mentioned Satan will not affect you, Allaah willing. It is narrated that Satan informed Abu Hurayrah, : "Whenever you go to bed, recite Ayat-al-Kursi [Quran 2:255]' till you finish the whole verse. (If you do so), Allaah will appoint a guard for you who will stay with you and no devil will come near you till morning.” The Prophet said: "He really spoke the truth, although he is an absolute liar." [Al-Bukhari]
Allaah Knows best.