I asked the Messenger of Allah(ﷺ) about looking to the sides during prayer. He said: It is something which the devil snatches from a servant’s prayers.
Sunan Abi Dawud Book 2, Hadith 521