Istinja’ means removing whatever has been passed from the front or back passages with water, stones, or anything else that is pure and will remove the impurity (najaasah) – such as pebbles or coarse tissue paper, or clean pieces of paper on which there is no mention of Allah or any of His names – apart from bones and dung. This is to be done when something impure is emitted, of stools or urine. But if nothing has come out apart from passing wind, then it is not obligatory to do instinjaa’.
It is not permissible to relieve oneself in the street or in the shade, because the Prophet (peace and blessings of Allah be upon him) said: “Beware of two things which provoke cursing.” They said, “What are the two things which provoke cursing, O Messenger of Allah?” He said, “Relieving oneself on the street or in the shade.” Sahih Muslim, book of Tahaarah, 397
It was 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: “The eyes of the jinn are blocked from seeing the ‘awraat of the sons of Adam when one of them says, on entering the washroom, ‘Bismillaah.’” Sunan at Tirmidhi, al-Jumu’ah, 551. Classed as saheeh by al-Albaani in Saheeh Sunan at-Tirmidhi, in 496
Prophet (peace and blessings of Allah be upon him) said: “Allahumma inni a’oozu bika min al-khubsi wa’l-khabaa’is (O Allah, I seek refuge in You from all offensive and wicked things (evil deeds and evil spirits).” Sahih al-Bukhaari, Book of al-Wudoo’, 139 He should enter with his left foot first, and exit with his right foot first.
It is mustahabb when coming out of the washroom to say “Ghufraanak (I ask You (Allah) for Your forgiveness),” because it was narrated that ‘Aa’ishah (may Allah be pleased with her) said: “When the Prophet (peace and blessings of Allah be upon him) came out of the washroom, he would say, ‘Ghufraanak.’” Sunan at Tirmidhi, al-Tahaarah, 7; classed as saheeh by al-Albaani in Saheeh Sunan al-Tirmidhi, no. 7 It is makrooh(not recomended) to speak whilst relieving oneself.
“When any one of you needs to defecate, let him not face the qiblah or turn his back toward it; face east or west” [because Makkah is south of Madeenah – Translator].” Sahih al-Bukhaari, al-Wudoo’, 141
When urinating, a person must be careful not to let drops of urine land on his clothes or body, because it was narrated in the hadeeth of Ibn ‘Abbaas that “the Prophet (peace and blessings of Allah be upon him) passed by one of the gardens of Madeenah or Makkah, and he heard the voices of two men who were being punished in their graves. The Prophet (peace and blessings of Allah be upon him) said: ‘They are being punished but they are not being punished for a major sin.’ Then he said, ‘No, one of them used not to take precautions to protect himself from his urine, and the other used to go about spreading slander.’ Then he called for a palm-branch, which he broke in two and placed each piece on a grave, It was said to him, ‘O Messenger of Allah, why did you do that?’ He said, ‘May their torment be reduced so long as these do not dry out’ or ‘until these dry out.’” Sahih al Bukhaari, al-Wudoo’, 209
He should not hold his penis with his right hand whilst urinating, because the Prophet (peace and blessings of Allah be upon him) said: “When any one of you goes to the lavatory, he should neither touch his penis nor clean his private parts with his right hand.” Sahih al-Bukhaari, book of Wudoo’, 149 
Istijmaar is valid whether one uses stones or tissue paper, even if water is available; there is no difference of opinion among the scholars on this point.
The evidence that istimaar using stones and the like is acceptable is the report narrated by Abu Hurayrah (may Allah be pleased with him), which says that the Messenger of Allah (peace and blessings of Allah be upon him) said: “Whoever does wudoo’, let him rinse his nose, and whoever does istijmaar let him use an odd number.” Sahih al-Bukhaari (159) and Muslim (237)
Ibn al-Qayyim (may Allah have mercy on him) said in Ighaathat al-Lahfaan (1/151) that there is consensus among the Muslims that it is permissible to do istijmaar using stones both in the winter and in the summer.
Doing istinja’ with water is better, because of the report narrated by Anas ibn Maalik (may Allah be pleased with him) who said: When I was a boy, when the Messenger of Allah (peace and blessings of Allah be upon him) entered the toilet I would carry a small vessel of leather filled with water, and he would clean himself with water. Sahih Muslim (271) and al-Nasaa’i (45)
Ibn Qudaamah (may Allah have mercy on him) said in al-Mughni (1/206):
If a person wants to do just one of them, then using water is better, because of the hadeeth that we have narrated, and because it purifies the place and removes the dirt itself and its traces, and is more cleansing.