Guide
What Invalidates the Prayer
Once a prayer has begun, certain actions bring it to an end and require it to be started again. Knowing them removes doubt and helps you pray with presence rather than worry. They fall into two groups: things that break the prayer itself, and things that break the ablution the prayer depends on.
Things that break the prayer
Widely agreed invalidators include: speaking deliberately (words unrelated to the prayer); eating or drinking; a lot of continuous extraneous movement; laughing out loud; deliberately leaving the direction of the Qibla; and uncovering the awrah (the parts that must be covered). Deliberately omitting an essential pillar of the prayer, such as a bow or prostration, also invalidates it.
Things that break the ablution
Because valid prayer requires ablution, anything that nullifies wudu during the prayer ends it too: using the toilet, passing wind, and deep sleep are agreed upon. Other matters — such as touching skin or bleeding — differ between the schools, so a Hanafi and a Shafi'i may draw the line in slightly different places.
Doubt and honest mistakes
An honest mistake — forgetting a unit, or being unsure how many you have prayed — does not automatically break the prayer. It is often corrected with the prostration of forgetfulness; see Sujood al-Sahw. Involuntary acts like a cough or a small unavoidable movement are excused.
What to do
If the prayer is genuinely invalidated, simply stop, restore ablution if needed, and begin the prayer again from the start within its time window. There is no penalty for an honest interruption.