مِشْكَاةُ الْمَصَابِيحِ
Mishkat al-Masabih 344
Purification
How to act when relieving oneself - Section 2
وَعَنْ جَابِرٍ قَالَ: كَانَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا أَرَادَ الْبَرَازَ انْطَلَقَ حَتَّى لَا يرَاهُ أحد. رَوَاهُ أَبُو دَاوُد
Jabir said that when the Prophet (ﷺ) wished to relieve himself he went off where no one could see him. Abu Dawud transmitted it.
Mishkat al-Masabih, 344صَحِيح (الألباني)