The ruling on praying while suppressing the urge to urinate or defecate.
If the time for prayer arrives and there is something present that disturbs one's prayer—such as the urge to urinate or otherwise—one should leave the mosque to perform ablution (Wudu). This is because the Prophet (peace be upon him) said: 'No prayer should be performed when food is served, nor when one is suppressing the two 'filths' (the urge to urinate or defecate).' > If these urges are bothering the person and causing distress, they should not pray. Instead, they should return home to relieve themselves, even if they miss the congregational prayer. Praying at home with humility (Khushu) and freedom from physical discomfort is better and more virtuous than praying with the Imam while struggling against the two 'filths'."
Islamic Evidences
لا صلاةَ بحَضْرَةِ طعامٍ ، ولا وهو يُدافِعُه الأَخْبَثانِ
— الراوي : عائشة أم المؤمنين | المحدث : الألباني | المصدر : صحيح الجامع | الصفحة أو الرقم : 7509 | التخريج : أخرجه مسلم (560)، وأبو داود (89)، وأحمد (24166) واللفظ لهم جميعا.