When a person relieves himself, there are three possible cases:
The first is to cleanse oneself with water alone. This is permissible according to the stronger view, although some of the early generations held an old contrary opinion, rejecting cleansing with water and saying, “How can I soil my hand with such foulness and filth?” The correct view is that it is permissible, and scholarly consensus subsequently settled upon its permissibility.
The evidence for this is the hadith of Anas, who said: “When the Prophet ﷺ entered the place of relieving himself, I and a boy about my age would carry a small vessel of water and a spear for him; then he would cleanse himself with water.” (3)
As for the reasoning, the basic means of removing impurities is water. Just as you remove impurity from your foot with water, so too you remove it with water when it has come from your body.
The second is to cleanse oneself with stones alone.
Cleansing oneself with stones is sufficient. This is established by both the statement and practice of the Messenger of Allah ﷺ.
As for his statement, it is the hadith of Salman, who said: “The Messenger of Allah ﷺ forbade us from cleansing ourselves with fewer than three stones.” (4)