I've heard from some lecture that some keep a minhag to have a special prayer before going to the bathroom. If there is such a thing - what is it and where to find it?
The prayer is mentioned in the gemara Berachos 60b, a prayer asking for the angels who accompany him to wait for him while he goes to the bathroom*. It is brought in the beginning of Shulchan Aruch Siman 3, but it says there that nowadays we are not accustomed to say it. The Mishnah Berurah there explains that the reason is because we do not assume that we are on such a great level that angels accompany us so that we need to ask them to wait for us until we come out of the bathroom.
*The text of the prayer (in English) is:
"Be honoured, you honoured and holy ones that minister to the Most High. Give honour to the God of Israel. Wait for me till I enter and do my needs, and return to you."