Answered by Shaykh Sohail Hanif, SunniPath Academy Teacher
I was told that if a person felt the call of nature, he must go to the toilet before praying otherwise it is makruh tahrimi and that one would have to repeat the prayer. Is this the case regardless of whether the person is in great need for the toilet or if there is no urgency?
It is indeed prohibitively disliked (makruh tahriman) to pray whilst one is suppressing one’s need to pass gas, urinate or defecate. If this need presents itself whilst one is praying, it is necessary (wajib) to cease praying and relieve oneself.
If one is not suppressing the need to visit the bathroom and it is not occupying one’s mind then the mere awareness that may be one should visit the toilet is not prohibitively disliked and one may continue praying. [Ibn Abidin]
Faraz adds: Top ulema (like Mufti Mahmoud Ashraf Usmani) add that if someone has baseless misgivings (waswasa), such that they keep breaking brayer to use the washroom without real need, then they should ignore their misgivings and simply go ahead and pray, unless they have a strong, undeniable urge.