When the Prophet (ﷺ) felt the need of relieving himself, he went far off where no one could see him.
Sunan Abi Dawud Book 1, Hadith 2