Anas bin Malik narrated that the Prophet ﷺ would say: "O Allah, I seek refuge in You from a prayer that is of no benefit. "
Explanation & Benefits
Shaykh Umar Farooq Saeedi
1549. Commentary: Among the prominent benefits of prayer is that which the Noble Qur’an has mentioned: (Indeed, prayer prohibits immorality and wrongdoing... Al-‘Ankabut: 45) Surely, prayer restrains from indecency and evil deeds. Likewise, that which is not accepted by Allah is also of no benefit.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 1549