First of all, we would like to make it clear that there are certain acts that, if done while performing Prayer, render the Prayer invalid. A Muslim should be aware of these things so as to avoid them.
Explaining these things, the prominent Muslim scholar Sheikh Faysal Mawlawi, Deputy Chairman of the European Council for Fatwa and Research states that: “As far as the validity of prayer is concerned, following are the acts that invalidate prayer:
1. Losing one of the requirements or the obligatory acts of Prayer. The Prophet (peace and blessings be upon him) said to a Bedouin: “Go and pray, for you have not prayed.” This was because the man had lost one of the requirements of Prayer. Among these requirements are facing the qiblah, covering the `awrah, and having a pure garment and place of Prayer.
2. Intentional eating and drinking, even if one eats or drinks a small amount. If it is done unintentionally, like out of forgetfulness or ignorance or one swallows some food remnants that were between the teeth, then one’s Prayer is still valid according to the Shafi`i and Hanbali Schools.
3. Deliberate talking in things that do not relate to Prayer. If it is done out of ignorance or forgetfulness, then the Prayer is still valid. This is based on the hadith of Mu`awiyah ibn Al-Hakam As-Silmi, who talked in Prayer out of ignorance. The Prophet (peace and blessings be upon him) did not ask him to perform it again. Rather, he just said, “This Prayer is not a place for ordinary speech. It is meant for tasbih (glorifying Allah), takbir (saying ‘Allah is the Greatest’) and reciting Qur’an.”
4. Intentional and unintentional many movements that do not relate to Prayer. If there is a dire need for one to move, like saving a drowning person, then one can terminate one’s Prayer.
5. Laughter, whether one can hear it oneself or others can hear it. As for just smiling, it is ok.
6. Committing a mistake in recitation that changes the meaning completely or when one utters words indicating kufr (disbelief).
7. The follower intentionally losing two obligatory acts of Prayer done by the imam without an excuse or precedes the imam with two obligatory acts. This is according to the Shafi`i School. If one precedes the imam with an excuse, then his Prayer is still invalid.
8. The follower correcting (the recitation of) a person who is not his imam or reminding him of some parts he has forgotten. This also applies to the imam who accepts the correction of a person who is not his follower [in Prayer].”