They say being alone is more dangerous with your nafs than being with people in the open. With people, you are easily able to control your actions and keep yourself from sinning but when you are alone, with only your nafs present and nobody to keep you in heel - that is the real test.
That is the time Satan tries his level best to get to you, to whisper in your heart and mind, making the bad seem so beautiful. That is the time when your Imaan is tested - if you believe and worship in Allah as if you see because although you see him not - he sees you.
I've realised & experienced that the more closer you try and become to Allah and come into the deen, the harder Shaytan tries to tempt you away from the straight path. And the only protection which you may attain is only through asking Allah and trying harder to come closer to him.
But sometimes people slip - we are all humans. When this happens, one should never give up hope, for the doors of mercy of Allah are open for those who sincerely repent.
O you who believe! Enter perfectly in Islâm (by obeying all the rules and
regulations of the Islâmic religion) and follow not the footsteps of Shaitân
(Satan). Verily! He is to you a plain enemy. (208)