Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
abudawud:2Musaddad b. Musarhad > ʿĪsá b. Yūnus > Ismāʿīl b. ʿAbd al-Malik > Abū al-Zubayr > Jābir b. ʿAbdullāh

When the Prophet ﷺ felt the need of relieving himself, he went far off where no one could see him.  

أبو داود:٢حَدَّثَنَا مُسَدَّدُ بْنُ مُسَرْهَدٍ حَدَّثَنَا عِيسَى بْنُ يُونُسَ أَخْبَرَنَا إِسْمَاعِيلُ بْنُ عَبْدِ الْمَلِكِ عَنْ أَبِي الزُّبَيْرِ عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ

أَنَّ النَّبِيَّ ﷺ كَانَ إِذَا أَرَادَ الْبَرَازَ انْطَلَقَ حَتَّى لاَ يَرَاهُ أَحَدٌ