How can a person conceal himself from the jinn when in the toilet?
Question

Are we alone when in the bathroom? Can there be Jinn in with us? If so, what steps do we need to take to protect our modesty?.
Praise be to Allah.It is known that the jinn can see people, but people cannot see the jinn. Allah says (interpretation of the meaning): 
“Verily, he [Shaytaan] and Qabeeluhu (his soldiers from the jinn or his tribe) see you from where you cannot see them”
[al-A’raaf 7:27]
Because the shayaateen (devils) are evil, they like to frequent dirty places. Allah says (interpretation of the meaning): 
“Bad statements are for bad people (or bad women for bad men) and bad people for bad statements (or bad men for bad women). Good statements are for good people (or good women for good men) and good people for good statements (or good men for good women)…”
[al-Noor 24:26] 
Hence the shayaateen frequent the places where humans relieve themselves, and they want to do them harm. 
The Prophet (peace and blessings of Allah be upon him) has told us what we should do so that Allah will protect us from the evil of the shayaateen when we enter the toilet. That is that before entering the place, the Muslim should say, “Bismillaah, Allahumma inni a’oodhu bika min al-khubthi wa’l-khabaa’ith (In the name of Allah, O Allah, I seek refuge with You from evil and from the male and female devils).” 
Al-Tirmidhi (no. 606) narrated from ‘Ali ibn Abi Taalib (may Allah be pleased with him) that the Messenger of Allah (peace and blessings of Allah be upon him) said: “A screen will be placed between the eyes of the jinn and the ‘awrah of the sons of Adam when one of them enters the toilet, if he says ‘Bismillaah (in the name of Allah).” (Classed as saheeh by al-Albaani in Saheeh al-Tirmidhi, 496). 
Abu Dawood (6) and Ibn Maajah (296) narrated that the Prophet (peace and blessings of Allah be upon him) said: “These toilets are visited (by jinn), so when any one of you goes to the toilet, let him say, ‘Allahumma inni a’oodhu bika min al-khubthi wa’l-khabaa’ith (O Allah, I seek refuge with You from evil and from the male and female devils).’” (Classed as saheeh by al-Albaani in Saheeh Ibn Maajah, 241). 
The word hushoosh, translated here as toilets, refers to places where people relieve themselves, and it includes the “water closets” that are in people’s houses. 
“Visited (by jinn)” means that they are frequented by the devils, with the intent to cause harm to people. 
Khubth means evil and khabaa’ith means evil souls, namely the devils, both male and female. So one is seeking refuge with Allah from evil and from those who do evil. 
From ‘Awn al-Ma’bood. 
If the Muslim says this du’aa’ before entering the toilet, Allah will grant him refuge from the devils. 
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: 
The benefit of saying Bismillaah is that it conceals a person. The benefit of seeking refuge with Allah is that one is turning to Allah from evil and from the male and female devils, for this place is filthy (khabeeth) and a filthy place is the abode of those who are evil (khubatha’).  So it is the abode  ofthe devils. Thus it is appropriate if one wants to enter the toilet to say  “A’oodhu Billaah min al-khubthi wa’l-khabaa’ith (I seek refuge with Allah from evil and from the male and female devils)” so that he will not be harmed by evil or by the evil souls. 
Al-Sharh al-Mumti’, 1/83. 
And Allah knows best.