It is mandatory to be in a state of cleanliness and physical purity before doing the Salaat. Achieving this state of physical purity, in general, involves either the Wudoo (ablution) or Ghusl (bathing) depending upon the type of impurity. If one has used the toilet, then before doing the Wudoo or Ghusl, one must remove any impurity or filth from one's private parts—a process known as Istinja.
Click these links for details.
Ja.naa.bah, or major impurity, includes having sexual intercourse and all types of male and female ejaculation. Click HERE for some common issues related to ja.naa.bah and the menstrual periods.
There are certain things which invalidate Wudoo and “break” the state of ritual purity.
— Passing stools
— Passing wind
— Any sexual discharge or the act of penetration during intercourse
— Deep sleep or being unconscious (dozing off for a few seconds doesn't count).
The type of impurity determines what kind of purification method is used (see table below).
Types of Impurities and
Purification from Them