The Sages teach that one who needs to use the bathroom, be it to urinate or to defecate, may not pray (Berakhot 23a). There are two reasons for this: 1. The need for relief is likely to disrupt one’s kavana (Rambam); and 2. It is not proper to come to pray before God when the body is made repulsive by the excrement inside it (Hagahot Maimoniyot). Even if one is uncertain as to whether or not she needs to use the bathroom, the Sages say that le-khatĥila one should use the bathroom (Berakhot 15a). The Sages support their statement with the verse (Amos 4:12), “Israel, prepare to meet your God.” It is also written: “Guard your foot when you go to the House of God” (Kohelet 4:17), which they interpret to mean that one should ensure that she does not need to relieve herself when she gets up to pray.
One who has a cold should wipe her nose before praying so that she need not do so while praying. If the phlegm in her throat bothers her, she should expel it before praying so that it does not distract her during prayers (SA 92:3). If she must wipe her nose while praying, she should do so in the most polite way possible. Similarly, if she needs to yawn, she should cover her mouth with her hand, because one who stands in prayer must be very careful to show honor to heaven, and all actions that are considered impolite before people are also prohibited during prayer (see SA 97:1-2).